home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1988-11-01 | 49.0 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| ZX81 Sinclair BASIC (image/sinclairBASIC)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Tue Nov 1 15:48:44 1988, modified Tue Nov 1 15:48:44 1988, creator 'MPS ', type ASCII, 48839 bytes "TESample.p" , at 0xbf47 1144 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 54 45 53 61 6d 70 | 6c 65 2e 70 00 00 00 00 |..TESamp|le.p....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 be c7 00 | 00 04 78 9f 93 d3 ac 9f |........|..x.....|
|00000060| 93 d3 ac 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 e0 64 00 00 |........|.....d..|
|00000080| 7b 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |{-------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |--------|-------.|
|000000d0| 23 0d 23 09 41 70 70 6c | 65 20 4d 61 63 69 6e 74 |#.#.Appl|e Macint|
|000000e0| 6f 73 68 20 44 65 76 65 | 6c 6f 70 65 72 20 54 65 |osh Deve|loper Te|
|000000f0| 63 68 6e 69 63 61 6c 20 | 53 75 70 70 6f 72 74 0d |chnical |Support.|
|00000100| 23 0d 23 09 4d 75 6c 74 | 69 46 69 6e 64 65 72 2d |#.#.Mult|iFinder-|
|00000110| 41 77 61 72 65 20 53 69 | 6d 70 6c 65 20 54 65 78 |Aware Si|mple Tex|
|00000120| 74 45 64 69 74 20 53 61 | 6d 70 6c 65 20 41 70 70 |tEdit Sa|mple App|
|00000130| 6c 69 63 61 74 69 6f 6e | 0d 23 0d 23 09 54 45 53 |lication|.#.#.TES|
|00000140| 61 6d 70 6c 65 0d 23 0d | 23 09 54 45 53 61 6d 70 |ample.#.|#.TESamp|
|00000150| 6c 65 2e 70 09 2d 09 50 | 61 73 63 61 6c 20 53 6f |le.p.-.P|ascal So|
|00000160| 75 72 63 65 0d 23 0d 23 | 09 43 6f 70 79 72 69 67 |urce.#.#|.Copyrig|
|00000170| 68 74 20 a9 20 31 39 38 | 38 20 41 70 70 6c 65 20 |ht . 198|8 Apple |
|00000180| 43 6f 6d 70 75 74 65 72 | 2c 20 49 6e 63 2e 0d 23 |Computer|, Inc..#|
|00000190| 09 41 6c 6c 20 72 69 67 | 68 74 73 20 72 65 73 65 |.All rig|hts rese|
|000001a0| 72 76 65 64 2e 0d 23 0d | 23 09 56 65 72 73 69 6f |rved..#.|#.Versio|
|000001b0| 6e 73 3a 09 31 2e 30 09 | 09 09 09 09 30 38 2f 38 |ns:.1.0.|....08/8|
|000001c0| 38 0d 23 09 09 09 09 31 | 2e 30 31 09 09 09 09 31 |8.#....1|.01....1|
|000001d0| 31 2f 38 38 0d 23 0d 23 | 09 43 6f 6d 70 6f 6e 65 |1/88.#.#|.Compone|
|000001e0| 6e 74 73 3a 09 54 45 53 | 61 6d 70 6c 65 2e 70 09 |nts:.TES|ample.p.|
|000001f0| 09 09 4e 6f 76 65 6d 62 | 65 72 20 31 2c 20 31 39 |..Novemb|er 1, 19|
|00000200| 38 38 0d 23 09 09 09 09 | 54 45 53 61 6d 70 6c 65 |88.#....|TESample|
|00000210| 2e 63 09 09 09 4e 6f 76 | 65 6d 62 65 72 20 31 2c |.c...Nov|ember 1,|
|00000220| 20 31 39 38 38 0d 23 09 | 09 09 09 54 45 53 61 6d | 1988.#.|...TESam|
|00000230| 70 6c 65 2e 61 09 09 09 | 4e 6f 76 65 6d 62 65 72 |ple.a...|November|
|00000240| 20 31 2c 20 31 39 38 38 | 0d 23 09 09 09 09 54 45 | 1, 1988|.#....TE|
|00000250| 53 61 6d 70 6c 65 2e 72 | 09 09 09 4e 6f 76 65 6d |Sample.r|...Novem|
|00000260| 62 65 72 20 31 2c 20 31 | 39 38 38 0d 23 09 09 09 |ber 1, 1|988.#...|
|00000270| 09 54 45 53 61 6d 70 6c | 65 2e 68 09 09 09 4e 6f |.TESampl|e.h...No|
|00000280| 76 65 6d 62 65 72 20 31 | 2c 20 31 39 38 38 0d 23 |vember 1|, 1988.#|
|00000290| 09 09 09 09 50 54 45 53 | 61 6d 70 6c 65 2e 6d 61 |....PTES|ample.ma|
|000002a0| 6b 65 09 09 4e 6f 76 65 | 6d 62 65 72 20 31 2c 20 |ke..Nove|mber 1, |
|000002b0| 31 39 38 38 0d 23 09 09 | 09 09 43 54 45 53 61 6d |1988.#..|..CTESam|
|000002c0| 70 6c 65 2e 6d 61 6b 65 | 09 09 4e 6f 76 65 6d 62 |ple.make|..Novemb|
|000002d0| 65 72 20 31 2c 20 31 39 | 38 38 0d 23 0d 23 09 54 |er 1, 19|88.#.#.T|
|000002e0| 45 53 61 6d 70 6c 65 20 | 69 73 20 61 6e 20 65 78 |ESample |is an ex|
|000002f0| 61 6d 70 6c 65 20 61 70 | 70 6c 69 63 61 74 69 6f |ample ap|plicatio|
|00000300| 6e 20 74 68 61 74 20 64 | 65 6d 6f 6e 73 74 72 61 |n that d|emonstra|
|00000310| 74 65 73 20 68 6f 77 20 | 0d 23 09 74 6f 20 69 6e |tes how |.#.to in|
|00000320| 69 74 69 61 6c 69 7a 65 | 20 74 68 65 20 63 6f 6d |itialize| the com|
|00000330| 6d 6f 6e 6c 79 20 75 73 | 65 64 20 74 6f 6f 6c 62 |monly us|ed toolb|
|00000340| 6f 78 20 6d 61 6e 61 67 | 65 72 73 2c 20 6f 70 65 |ox manag|ers, ope|
|00000350| 72 61 74 65 20 0d 23 09 | 73 75 63 63 65 73 73 66 |rate .#.|successf|
|00000360| 75 6c 6c 79 20 75 6e 64 | 65 72 20 4d 75 6c 74 69 |ully und|er Multi|
|00000370| 46 69 6e 64 65 72 2c 20 | 68 61 6e 64 6c 65 20 64 |Finder, |handle d|
|00000380| 65 73 6b 20 61 63 63 65 | 73 73 6f 72 69 65 73 20 |esk acce|ssories |
|00000390| 61 6e 64 20 0d 23 09 63 | 72 65 61 74 65 2c 20 67 |and .#.c|reate, g|
|000003a0| 72 6f 77 2c 20 61 6e 64 | 20 7a 6f 6f 6d 20 77 69 |row, and| zoom wi|
|000003b0| 6e 64 6f 77 73 2e 20 54 | 68 65 20 66 75 6e 64 61 |ndows. T|he funda|
|000003c0| 6d 65 6e 74 61 6c 20 54 | 65 78 74 45 64 69 74 20 |mental T|extEdit |
|000003d0| 0d 23 09 74 6f 6f 6c 62 | 6f 78 20 63 61 6c 6c 73 |.#.toolb|ox calls|
|000003e0| 20 61 6e 64 20 54 65 78 | 74 45 64 69 74 20 61 75 | and Tex|tEdit au|
|000003f0| 74 6f 73 63 72 6f 6c 6c | 20 61 72 65 20 64 65 6d |toscroll| are dem|
|00000400| 6f 6e 73 74 72 61 74 65 | 64 2e 20 49 74 20 0d 23 |onstrate|d. It .#|
|00000410| 09 61 6c 73 6f 20 73 68 | 6f 77 73 20 68 6f 77 20 |.also sh|ows how |
|00000420| 74 6f 20 63 72 65 61 74 | 65 20 61 6e 64 20 6d 61 |to creat|e and ma|
|00000430| 69 6e 74 61 69 6e 20 73 | 63 72 6f 6c 6c 62 61 72 |intain s|crollbar|
|00000440| 20 63 6f 6e 74 72 6f 6c | 73 2e 0d 23 0d 23 09 49 | control|s..#.#.I|
|00000450| 74 20 64 6f 65 73 20 6e | 6f 74 20 62 79 20 61 6e |t does n|ot by an|
|00000460| 79 20 6d 65 61 6e 73 20 | 64 65 6d 6f 6e 73 74 72 |y means |demonstr|
|00000470| 61 74 65 20 61 6c 6c 20 | 74 68 65 20 74 65 63 68 |ate all |the tech|
|00000480| 6e 69 71 75 65 73 20 79 | 6f 75 20 0d 23 09 6e 65 |niques y|ou .#.ne|
|00000490| 65 64 20 66 6f 72 20 61 | 20 6c 61 72 67 65 20 61 |ed for a| large a|
|000004a0| 70 70 6c 69 63 61 74 69 | 6f 6e 2e 20 49 6e 20 70 |pplicati|on. In p|
|000004b0| 61 72 74 69 63 75 6c 61 | 72 2c 20 53 61 6d 70 6c |articula|r, Sampl|
|000004c0| 65 20 64 6f 65 73 20 6e | 6f 74 20 0d 23 09 63 6f |e does n|ot .#.co|
|000004d0| 76 65 72 20 65 78 63 65 | 70 74 69 6f 6e 20 68 61 |ver exce|ption ha|
|000004e0| 6e 64 6c 69 6e 67 2c 20 | 6d 75 6c 74 69 70 6c 65 |ndling, |multiple|
|000004f0| 20 77 69 6e 64 6f 77 73 | 2f 64 6f 63 75 6d 65 6e | windows|/documen|
|00000500| 74 73 2c 20 0d 23 09 73 | 6f 70 68 69 73 74 69 63 |ts, .#.s|ophistic|
|00000510| 61 74 65 64 20 6d 65 6d | 6f 72 79 20 6d 61 6e 61 |ated mem|ory mana|
|00000520| 67 65 6d 65 6e 74 2c 20 | 70 72 69 6e 74 69 6e 67 |gement, |printing|
|00000530| 2c 20 6f 72 20 75 6e 64 | 6f 2e 20 41 6c 6c 20 6f |, or und|o. All o|
|00000540| 66 20 0d 23 09 74 68 65 | 73 65 20 61 72 65 20 76 |f .#.the|se are v|
|00000550| 69 74 61 6c 20 70 61 72 | 74 73 20 6f 66 20 61 20 |ital par|ts of a |
|00000560| 6e 6f 72 6d 61 6c 20 66 | 75 6c 6c 2d 73 69 7a 65 |normal f|ull-size|
|00000570| 64 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 2e 0d 23 |d applic|ation..#|
|00000580| 0d 23 09 54 68 69 73 20 | 61 70 70 6c 69 63 61 74 |.#.This |applicat|
|00000590| 69 6f 6e 20 69 73 20 61 | 6e 20 65 78 61 6d 70 6c |ion is a|n exampl|
|000005a0| 65 20 6f 66 20 74 68 65 | 20 66 6f 72 6d 20 6f 66 |e of the| form of|
|000005b0| 20 61 20 4d 61 63 69 6e | 74 6f 73 68 20 0d 23 09 | a Macin|tosh .#.|
|000005c0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 3b 20 69 74 20 |applicat|ion; it |
|000005d0| 69 73 20 4e 4f 54 20 61 | 20 74 65 6d 70 6c 61 74 |is NOT a| templat|
|000005e0| 65 2e 20 49 74 20 69 73 | 20 4e 4f 54 20 69 6e 74 |e. It is| NOT int|
|000005f0| 65 6e 64 65 64 20 74 6f | 20 62 65 20 0d 23 09 75 |ended to| be .#.u|
|00000600| 73 65 64 20 61 73 20 61 | 20 66 6f 75 6e 64 61 74 |sed as a| foundat|
|00000610| 69 6f 6e 20 66 6f 72 20 | 74 68 65 20 6e 65 78 74 |ion for |the next|
|00000620| 20 77 6f 72 6c 64 2d 63 | 6c 61 73 73 2c 20 62 65 | world-c|lass, be|
|00000630| 73 74 2d 73 65 6c 6c 69 | 6e 67 2c 20 0d 23 09 36 |st-selli|ng, .#.6|
|00000640| 30 30 4b 20 61 70 70 6c | 69 63 61 74 69 6f 6e 2e |00K appl|ication.|
|00000650| 20 41 20 73 74 69 63 6b | 20 66 69 67 75 72 65 20 | A stick| figure |
|00000660| 64 72 61 77 69 6e 67 20 | 6f 66 20 74 68 65 20 68 |drawing |of the h|
|00000670| 75 6d 61 6e 20 62 6f 64 | 79 20 6d 61 79 20 0d 23 |uman bod|y may .#|
|00000680| 09 62 65 20 61 20 67 6f | 6f 64 20 65 78 61 6d 70 |.be a go|od examp|
|00000690| 6c 65 20 6f 66 20 74 68 | 65 20 66 6f 72 6d 20 66 |le of th|e form f|
|000006a0| 6f 72 20 61 20 70 61 69 | 6e 74 69 6e 67 2c 20 62 |or a pai|nting, b|
|000006b0| 75 74 20 74 68 61 74 20 | 64 6f 65 73 20 6e 6f 74 |ut that |does not|
|000006c0| 20 0d 23 09 6d 65 61 6e | 20 69 74 20 73 68 6f 75 | .#.mean| it shou|
|000006d0| 6c 64 20 62 65 20 75 73 | 65 64 20 61 73 20 74 68 |ld be us|ed as th|
|000006e0| 65 20 62 61 73 69 73 20 | 66 6f 72 20 74 68 65 20 |e basis |for the |
|000006f0| 6e 65 78 74 20 4d 6f 6e | 61 20 4c 69 73 61 2e 0d |next Mon|a Lisa..|
|00000700| 23 0d 23 09 57 65 20 72 | 65 63 6f 6d 6d 65 6e 64 |#.#.We r|ecommend|
|00000710| 20 74 68 61 74 20 79 6f | 75 20 72 65 76 69 65 77 | that yo|u review|
|00000720| 20 74 68 69 73 20 70 72 | 6f 67 72 61 6d 20 6f 72 | this pr|ogram or|
|00000730| 20 53 61 6d 70 6c 65 20 | 62 65 66 6f 72 65 20 0d | Sample |before .|
|00000740| 23 09 62 65 67 69 6e 6e | 69 6e 67 20 61 20 6e 65 |#.beginn|ing a ne|
|00000750| 77 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 2e 20 53 |w applic|ation. S|
|00000760| 61 6d 70 6c 65 20 69 73 | 20 61 20 73 69 6d 70 6c |ample is| a simpl|
|00000770| 65 20 61 70 70 2e 20 77 | 68 69 63 68 20 64 6f 65 |e app. w|hich doe|
|00000780| 73 6e d5 74 20 0d 23 09 | 75 73 65 20 54 65 78 74 |sn.t .#.|use Text|
|00000790| 45 64 69 74 20 6f 72 20 | 74 68 65 20 43 6f 6e 74 |Edit or |the Cont|
|000007a0| 72 6f 6c 20 4d 61 6e 61 | 67 65 72 2e 0d 23 0d 2d |rol Mana|ger..#.-|
|000007b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000007c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000007d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000007e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000007f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 7d 0d 0d |--------|-----}..|
|00000800| 0d 50 52 4f 47 52 41 4d | 20 54 45 53 61 6d 70 6c |.PROGRAM| TESampl|
|00000810| 65 3b 0d 0d 0d 7b 53 65 | 67 6d 65 6e 74 61 74 69 |e;...{Se|gmentati|
|00000820| 6f 6e 20 73 74 72 61 74 | 65 67 79 3a 0d 0d 20 54 |on strat|egy:.. T|
|00000830| 68 69 73 20 70 72 6f 67 | 72 61 6d 20 63 6f 6e 73 |his prog|ram cons|
|00000840| 69 73 74 73 20 6f 66 20 | 74 68 72 65 65 20 73 65 |ists of |three se|
|00000850| 67 6d 65 6e 74 73 2e 20 | 4d 61 69 6e 20 63 6f 6e |gments. |Main con|
|00000860| 74 61 69 6e 73 20 6d 6f | 73 74 20 6f 66 20 74 68 |tains mo|st of th|
|00000870| 65 20 63 6f 64 65 2c 0d | 20 69 6e 63 6c 75 64 69 |e code,.| includi|
|00000880| 6e 67 20 74 68 65 20 4d | 50 57 20 6c 69 62 72 61 |ng the M|PW libra|
|00000890| 72 69 65 73 2c 20 61 6e | 64 20 74 68 65 20 6d 61 |ries, an|d the ma|
|000008a0| 69 6e 20 70 72 6f 67 72 | 61 6d 2e 20 49 6e 69 74 |in progr|am. Init|
|000008b0| 69 61 6c 69 7a 65 20 63 | 6f 6e 74 61 69 6e 73 0d |ialize c|ontains.|
|000008c0| 20 63 6f 64 65 20 74 68 | 61 74 20 69 73 20 6f 6e | code th|at is on|
|000008d0| 6c 79 20 75 73 65 64 20 | 6f 6e 63 65 2c 20 64 75 |ly used |once, du|
|000008e0| 72 69 6e 67 20 73 74 61 | 72 74 75 70 2c 20 61 6e |ring sta|rtup, an|
|000008f0| 64 20 63 61 6e 20 62 65 | 20 75 6e 6c 6f 61 64 65 |d can be| unloade|
|00000900| 64 20 61 66 74 65 72 20 | 74 68 65 0d 20 70 72 6f |d after |the. pro|
|00000910| 67 72 61 6d 20 73 74 61 | 72 74 73 2e 20 25 41 35 |gram sta|rts. %A5|
|00000920| 49 6e 69 74 20 69 73 20 | 61 75 74 6f 6d 61 74 69 |Init is |automati|
|00000930| 63 61 6c 6c 79 20 63 72 | 65 61 74 65 64 20 62 79 |cally cr|eated by|
|00000940| 20 74 68 65 20 4c 69 6e | 6b 65 72 20 74 6f 20 69 | the Lin|ker to i|
|00000950| 6e 69 74 69 61 6c 69 7a | 65 0d 20 67 6c 6f 62 61 |nitializ|e. globa|
|00000960| 6c 73 20 66 6f 72 20 74 | 68 65 20 4d 50 57 20 6c |ls for t|he MPW l|
|00000970| 69 62 72 61 72 69 65 73 | 20 61 6e 64 20 69 73 20 |ibraries| and is |
|00000980| 75 6e 6c 6f 61 64 65 64 | 20 72 69 67 68 74 20 61 |unloaded| right a|
|00000990| 77 61 79 2e 7d 0d 0d 0d | 7b 53 65 74 50 6f 72 74 |way.}...|{SetPort|
|000009a0| 20 73 74 72 61 74 65 67 | 79 3a 0d 0d 20 54 6f 6f | strateg|y:.. Too|
|000009b0| 6c 62 6f 78 20 72 6f 75 | 74 69 6e 65 73 20 64 6f |lbox rou|tines do|
|000009c0| 20 6e 6f 74 20 63 68 61 | 6e 67 65 20 74 68 65 20 | not cha|nge the |
|000009d0| 63 75 72 72 65 6e 74 20 | 70 6f 72 74 2e 20 49 6e |current |port. In|
|000009e0| 20 73 70 69 74 65 20 6f | 66 20 74 68 69 73 2c 20 | spite o|f this, |
|000009f0| 69 6e 20 74 68 69 73 0d | 20 70 72 6f 67 72 61 6d |in this.| program|
|00000a00| 20 77 65 20 75 73 65 20 | 61 20 73 74 72 61 74 65 | we use |a strate|
|00000a10| 67 79 20 6f 66 20 63 61 | 6c 6c 69 6e 67 20 53 65 |gy of ca|lling Se|
|00000a20| 74 50 6f 72 74 20 77 68 | 65 6e 65 76 65 72 20 77 |tPort wh|enever w|
|00000a30| 65 20 77 61 6e 74 20 74 | 6f 20 64 72 61 77 20 6f |e want t|o draw o|
|00000a40| 72 0d 20 6d 61 6b 65 20 | 63 61 6c 6c 73 20 77 68 |r. make |calls wh|
|00000a50| 69 63 68 20 64 65 70 65 | 6e 64 20 6f 6e 20 74 68 |ich depe|nd on th|
|00000a60| 65 20 63 75 72 72 65 6e | 74 20 70 6f 72 74 2e 20 |e curren|t port. |
|00000a70| 54 68 69 73 20 6d 61 6b | 65 73 20 75 73 20 6c 65 |This mak|es us le|
|00000a80| 73 73 20 76 75 6c 6e 65 | 72 61 62 6c 65 0d 20 74 |ss vulne|rable. t|
|00000a90| 6f 20 62 75 67 73 20 69 | 6e 20 6f 74 68 65 72 20 |o bugs i|n other |
|00000aa0| 73 6f 66 74 77 61 72 65 | 20 77 68 69 63 68 20 6d |software| which m|
|00000ab0| 69 67 68 74 20 61 6c 74 | 65 72 20 74 68 65 20 63 |ight alt|er the c|
|00000ac0| 75 72 72 65 6e 74 20 70 | 6f 72 74 20 28 73 75 63 |urrent p|ort (suc|
|00000ad0| 68 20 61 73 20 74 68 65 | 0d 20 62 75 67 20 28 66 |h as the|. bug (f|
|00000ae0| 65 61 74 75 72 65 3f 29 | 20 69 6e 20 6d 61 6e 79 |eature?)| in many|
|00000af0| 20 64 65 73 6b 20 61 63 | 63 65 73 73 6f 72 69 65 | desk ac|cessorie|
|00000b00| 73 20 77 68 69 63 68 20 | 63 68 61 6e 67 65 20 74 |s which |change t|
|00000b10| 68 65 20 70 6f 72 74 20 | 6f 6e 20 4f 70 65 6e 44 |he port |on OpenD|
|00000b20| 65 73 6b 41 63 63 29 2e | 0d 20 48 6f 70 65 66 75 |eskAcc).|. Hopefu|
|00000b30| 6c 6c 79 2c 20 74 68 69 | 73 20 61 6c 73 6f 20 6d |lly, thi|s also m|
|00000b40| 61 6b 65 73 20 74 68 65 | 20 72 6f 75 74 69 6e 65 |akes the| routine|
|00000b50| 73 20 66 72 6f 6d 20 74 | 68 69 73 20 70 72 6f 67 |s from t|his prog|
|00000b60| 72 61 6d 20 6d 6f 72 65 | 20 73 65 6c 66 2d 63 6f |ram more| self-co|
|00000b70| 6e 74 61 69 6e 65 64 2c | 0d 20 73 69 6e 63 65 20 |ntained,|. since |
|00000b80| 74 68 65 79 20 64 6f 6e | 27 74 20 64 65 70 65 6e |they don|'t depen|
|00000b90| 64 20 6f 6e 20 74 68 65 | 20 63 75 72 72 65 6e 74 |d on the| current|
|00000ba0| 20 70 6f 72 74 20 73 65 | 74 74 69 6e 67 2e 7d 0d | port se|tting.}.|
|00000bb0| 0d 0d 7b 43 6c 69 70 62 | 6f 61 72 64 20 73 74 72 |..{Clipb|oard str|
|00000bc0| 61 74 65 67 79 3a 0d 0d | 20 54 68 69 73 20 70 72 |ategy:..| This pr|
|00000bd0| 6f 67 72 61 6d 20 64 6f | 65 73 20 6e 6f 74 20 6d |ogram do|es not m|
|00000be0| 61 69 6e 74 61 69 6e 20 | 61 20 70 72 69 76 61 74 |aintain |a privat|
|00000bf0| 65 20 73 63 72 61 70 2e | 20 57 68 65 6e 65 76 65 |e scrap.| Wheneve|
|00000c00| 72 20 61 20 63 75 74 2c | 20 63 6f 70 79 2c 20 6f |r a cut,| copy, o|
|00000c10| 72 20 70 61 73 74 65 0d | 20 6f 63 63 75 72 73 2c |r paste.| occurs,|
|00000c20| 20 77 65 20 69 6d 70 6f | 72 74 2f 65 78 70 6f 72 | we impo|rt/expor|
|00000c30| 74 20 66 72 6f 6d 20 74 | 68 65 20 70 75 62 6c 69 |t from t|he publi|
|00000c40| 63 20 73 63 72 61 70 20 | 74 6f 20 54 65 78 74 45 |c scrap |to TextE|
|00000c50| 64 69 74 27 73 20 73 63 | 72 61 70 20 72 69 67 68 |dit's sc|rap righ|
|00000c60| 74 20 61 77 61 79 2c 0d | 20 75 73 69 6e 67 20 74 |t away,.| using t|
|00000c70| 68 65 20 54 45 54 6f 53 | 63 72 61 70 20 61 6e 64 |he TEToS|crap and|
|00000c80| 20 54 45 46 72 6f 6d 53 | 63 72 61 70 20 72 6f 75 | TEFromS|crap rou|
|00000c90| 74 69 6e 65 73 2e 20 49 | 66 20 77 65 20 64 69 64 |tines. I|f we did|
|00000ca0| 20 75 73 65 20 61 20 70 | 72 69 76 61 74 65 20 73 | use a p|rivate s|
|00000cb0| 63 72 61 70 2c 0d 20 74 | 68 65 20 69 6d 70 6f 72 |crap,. t|he impor|
|00000cc0| 74 2f 65 78 70 6f 72 74 | 20 77 6f 75 6c 64 20 62 |t/export| would b|
|00000cd0| 65 20 69 6e 20 74 68 65 | 20 61 63 74 69 76 61 74 |e in the| activat|
|00000ce0| 65 2f 64 65 61 63 74 69 | 76 61 74 65 20 65 76 65 |e/deacti|vate eve|
|00000cf0| 6e 74 20 61 6e 64 20 73 | 75 73 70 65 6e 64 2f 72 |nt and s|uspend/r|
|00000d00| 65 73 75 6d 65 0d 20 65 | 76 65 6e 74 20 72 6f 75 |esume. e|vent rou|
|00000d10| 74 69 6e 65 73 2e 7d 0d | 0d 7b 24 44 2b 7d 0d 0d |tines.}.|.{$D+}..|
|00000d20| 55 53 45 53 0d 09 4d 65 | 6d 54 79 70 65 73 2c 20 |USES..Me|mTypes, |
|00000d30| 51 75 69 63 6b 44 72 61 | 77 2c 20 4f 53 49 6e 74 |QuickDra|w, OSInt|
|00000d40| 66 2c 20 54 6f 6f 6c 49 | 6e 74 66 2c 20 50 61 63 |f, ToolI|ntf, Pac|
|00000d50| 6b 49 6e 74 66 3b 0d 0d | 0d 43 4f 4e 53 54 0d 09 |kIntf;..|.CONST..|
|00000d60| 7b 4d 50 57 20 33 2e 30 | 20 77 69 6c 6c 20 69 6e |{MPW 3.0| will in|
|00000d70| 63 6c 75 64 65 20 61 20 | 54 72 61 70 73 2e 70 20 |clude a |Traps.p |
|00000d80| 69 6e 74 65 72 66 61 63 | 65 20 66 69 6c 65 20 74 |interfac|e file t|
|00000d90| 68 61 74 20 69 6e 63 6c | 75 64 65 73 20 63 6f 6e |hat incl|udes con|
|00000da0| 73 74 61 6e 74 73 20 66 | 6f 72 20 74 72 61 70 20 |stants f|or trap |
|00000db0| 6e 75 6d 62 65 72 73 2e | 0d 09 20 54 68 65 73 65 |numbers.|.. These|
|00000dc0| 20 63 6f 6e 73 74 61 6e | 74 73 20 61 72 65 20 66 | constan|ts are f|
|00000dd0| 72 6f 6d 20 74 68 61 74 | 20 66 69 6c 65 2e 7d 0d |rom that| file.}.|
|00000de0| 09 5f 57 61 69 74 4e 65 | 78 74 45 76 65 6e 74 09 |._WaitNe|xtEvent.|
|00000df0| 09 09 3d 20 24 41 38 36 | 30 3b 0d 09 5f 55 6e 69 |..= $A86|0;.._Uni|
|00000e00| 6d 70 6c 65 6d 65 6e 74 | 65 64 09 09 09 3d 20 24 |mplement|ed...= $|
|00000e10| 41 38 39 46 3b 0d 0d 09 | 7b 31 2e 30 31 20 2d 20 |A89F;...|{1.01 - |
|00000e20| 63 68 61 6e 67 65 64 20 | 63 6f 6e 73 74 61 6e 74 |changed |constant|
|00000e30| 73 20 74 6f 20 62 65 67 | 69 6e 20 77 69 74 68 20 |s to beg|in with |
|00000e40| 27 6b 27 20 66 6f 72 20 | 63 6f 6e 73 69 73 74 65 |'k' for |consiste|
|00000e50| 6e 63 79 2c 20 65 78 63 | 65 70 74 20 66 6f 72 20 |ncy, exc|ept for |
|00000e60| 72 65 73 6f 75 72 63 65 | 20 49 44 73 7d 0d 09 7b |resource| IDs}..{|
|00000e70| 6b 54 65 78 74 4d 61 72 | 67 69 6e 20 69 73 20 74 |kTextMar|gin is t|
|00000e80| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 70 69 78 |he numbe|r of pix|
|00000e90| 65 6c 73 20 77 65 20 6c | 65 61 76 65 20 62 6c 61 |els we l|eave bla|
|00000ea0| 6e 6b 20 61 74 20 74 68 | 65 20 65 64 67 65 20 6f |nk at th|e edge o|
|00000eb0| 66 20 74 68 65 20 77 69 | 6e 64 6f 77 2e 7d 0d 09 |f the wi|ndow.}..|
|00000ec0| 6b 54 65 78 74 4d 61 72 | 67 69 6e 09 09 09 09 3d |kTextMar|gin....=|
|00000ed0| 20 32 3b 0d 0d 09 7b 6b | 4d 61 78 4f 70 65 6e 44 | 2;...{k|MaxOpenD|
|00000ee0| 6f 63 75 6d 65 6e 74 73 | 20 69 73 20 75 73 65 64 |ocuments| is used|
|00000ef0| 20 74 6f 20 64 65 74 65 | 72 6d 69 6e 65 20 77 68 | to dete|rmine wh|
|00000f00| 65 74 68 65 72 20 61 20 | 6e 65 77 20 64 6f 63 75 |ether a |new docu|
|00000f10| 6d 65 6e 74 20 63 61 6e | 20 62 65 20 6f 70 65 6e |ment can| be open|
|00000f20| 65 64 0d 09 20 6f 72 20 | 63 72 65 61 74 65 64 2e |ed.. or |created.|
|00000f30| 20 57 65 20 6b 65 65 70 | 20 74 72 61 63 6b 20 6f | We keep| track o|
|00000f40| 66 20 74 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |f the nu|mber of |
|00000f50| 6f 70 65 6e 20 64 6f 63 | 75 6d 65 6e 74 73 2c 20 |open doc|uments, |
|00000f60| 61 6e 64 20 64 69 73 61 | 62 6c 65 20 74 68 65 0d |and disa|ble the.|
|00000f70| 09 20 6d 65 6e 75 20 69 | 74 65 6d 73 20 74 68 61 |. menu i|tems tha|
|00000f80| 74 20 63 72 65 61 74 65 | 20 61 20 6e 65 77 20 64 |t create| a new d|
|00000f90| 6f 63 75 6d 65 6e 74 20 | 77 68 65 6e 20 74 68 65 |ocument |when the|
|00000fa0| 20 6d 61 78 69 6d 75 6d | 20 69 73 20 72 65 61 63 | maximum| is reac|
|00000fb0| 68 65 64 2e 20 49 66 20 | 74 68 65 0d 09 20 6e 75 |hed. If |the.. nu|
|00000fc0| 6d 62 65 72 20 6f 66 20 | 64 6f 63 75 6d 65 6e 74 |mber of |document|
|00000fd0| 73 20 66 61 6c 6c 73 20 | 62 65 6c 6f 77 20 74 68 |s falls |below th|
|00000fe0| 65 20 6d 61 78 69 6d 75 | 6d 2c 20 74 68 65 20 69 |e maximu|m, the i|
|00000ff0| 74 65 6d 73 20 61 72 65 | 20 65 6e 61 62 6c 65 64 |tems are| enabled|
|00001000| 20 61 67 61 69 6e 2e 7d | 0d 09 6b 4d 61 78 4f 70 | again.}|..kMaxOp|
|00001010| 65 6e 44 6f 63 75 6d 65 | 6e 74 73 09 09 3d 20 31 |enDocume|nts..= 1|
|00001020| 3b 0d 09 0d 09 7b 6b 4d | 61 78 44 6f 63 57 69 64 |;....{kM|axDocWid|
|00001030| 74 68 20 69 73 20 61 6e | 20 61 72 62 69 74 72 61 |th is an| arbitra|
|00001040| 72 79 20 6e 75 6d 62 65 | 72 20 75 73 65 64 20 74 |ry numbe|r used t|
|00001050| 6f 20 73 70 65 63 69 66 | 79 20 74 68 65 20 77 69 |o specif|y the wi|
|00001060| 64 74 68 20 6f 66 20 74 | 68 65 20 54 45 52 65 63 |dth of t|he TERec|
|00001070| 27 73 0d 09 64 65 73 74 | 69 6e 61 74 69 6f 6e 20 |'s..dest|ination |
|00001080| 72 65 63 74 61 6e 67 6c | 65 20 73 6f 20 74 68 61 |rectangl|e so tha|
|00001090| 74 20 77 6f 72 64 20 77 | 72 61 70 20 61 6e 64 20 |t word w|rap and |
|000010a0| 68 6f 72 69 7a 6f 6e 74 | 61 6c 20 73 63 72 6f 6c |horizont|al scrol|
|000010b0| 6c 69 6e 67 20 63 61 6e | 20 62 65 0d 09 64 65 6d |ling can| be..dem|
|000010c0| 6f 6e 73 74 72 61 74 65 | 64 2e 7d 0d 09 6b 4d 61 |onstrate|d.}..kMa|
|000010d0| 78 44 6f 63 57 69 64 74 | 68 09 09 09 3d 20 35 37 |xDocWidt|h...= 57|
|000010e0| 36 3b 0d 09 0d 09 7b 6b | 4d 69 6e 44 6f 63 44 69 |6;....{k|MinDocDi|
|000010f0| 6d 20 69 73 20 75 73 65 | 64 20 74 6f 20 6c 69 6d |m is use|d to lim|
|00001100| 69 74 20 74 68 65 20 6d | 69 6e 69 6d 75 6d 20 64 |it the m|inimum d|
|00001110| 69 6d 65 6e 73 69 6f 6e | 20 6f 66 20 61 20 77 69 |imension| of a wi|
|00001120| 6e 64 6f 77 20 77 68 65 | 6e 20 47 72 6f 77 57 69 |ndow whe|n GrowWi|
|00001130| 6e 64 6f 77 0d 09 69 73 | 20 63 61 6c 6c 65 64 2e |ndow..is| called.|
|00001140| 7d 0d 09 6b 4d 69 6e 44 | 6f 63 44 69 6d 09 09 09 |}..kMinD|ocDim...|
|00001150| 09 3d 20 36 34 3b 0d 09 | 0d 09 7b 6b 43 6f 6e 74 |.= 64;..|..{kCont|
|00001160| 72 6f 6c 49 6e 76 69 73 | 69 62 6c 65 20 69 73 20 |rolInvis|ible is |
|00001170| 75 73 65 64 20 74 6f 20 | 27 74 75 72 6e 20 6f 66 |used to |'turn of|
|00001180| 66 27 20 63 6f 6e 74 72 | 6f 6c 73 20 28 69 2e 65 |f' contr|ols (i.e|
|00001190| 2e 2c 20 63 61 75 73 65 | 20 74 68 65 20 63 6f 6e |., cause| the con|
|000011a0| 74 72 6f 6c 20 6e 6f 74 | 0d 09 74 6f 20 62 65 20 |trol not|..to be |
|000011b0| 72 65 64 72 61 77 6e 20 | 61 73 20 61 20 72 65 73 |redrawn |as a res|
|000011c0| 75 6c 74 20 6f 66 20 73 | 6f 6d 65 20 43 6f 6e 74 |ult of s|ome Cont|
|000011d0| 72 6f 6c 20 4d 61 6e 61 | 67 65 72 20 63 61 6c 6c |rol Mana|ger call|
|000011e0| 20 73 75 63 68 20 61 73 | 20 53 65 74 43 74 6c 56 | such as| SetCtlV|
|000011f0| 61 6c 75 65 29 0d 09 62 | 79 20 62 65 69 6e 67 20 |alue)..b|y being |
|00001200| 70 75 74 20 69 6e 74 6f | 20 74 68 65 20 63 6f 6e |put into| the con|
|00001210| 74 72 6c 56 69 73 20 66 | 69 65 6c 64 20 6f 66 20 |trlVis f|ield of |
|00001220| 74 68 65 20 72 65 63 6f | 72 64 2e 20 6b 43 6f 6e |the reco|rd. kCon|
|00001230| 74 72 6f 6c 56 69 73 69 | 62 6c 65 20 69 73 20 75 |trolVisi|ble is u|
|00001240| 73 65 64 0d 09 74 68 65 | 20 73 61 6d 65 20 77 61 |sed..the| same wa|
|00001250| 79 20 74 6f 20 27 74 75 | 72 6e 20 6f 6e 27 20 74 |y to 'tu|rn on' t|
|00001260| 68 65 20 63 6f 6e 74 72 | 6f 6c 2e 7d 0d 09 6b 43 |he contr|ol.}..kC|
|00001270| 6f 6e 74 72 6f 6c 49 6e | 76 69 73 69 62 6c 65 09 |ontrolIn|visible.|
|00001280| 09 3d 20 30 3b 0d 09 6b | 43 6f 6e 74 72 6f 6c 56 |.= 0;..k|ControlV|
|00001290| 69 73 69 62 6c 65 09 09 | 09 3d 20 24 46 46 3b 0d |isible..|.= $FF;.|
|000012a0| 09 0d 09 7b 6b 53 63 72 | 6f 6c 6c 42 61 72 41 64 |...{kScr|ollBarAd|
|000012b0| 6a 75 73 74 20 61 6e 64 | 20 6b 53 63 72 6f 6c 6c |just and| kScroll|
|000012c0| 42 61 72 57 69 64 74 68 | 20 61 72 65 20 75 73 65 |BarWidth| are use|
|000012d0| 64 20 69 6e 20 63 61 6c | 63 75 6c 61 74 69 6e 67 |d in cal|culating|
|000012e0| 0d 09 76 61 6c 75 65 73 | 20 66 6f 72 20 63 6f 6e |..values| for con|
|000012f0| 74 72 6f 6c 20 70 6f 73 | 69 74 69 6f 6e 69 6e 67 |trol pos|itioning|
|00001300| 20 61 6e 64 20 73 69 7a | 69 6e 67 2e 7d 0d 09 6b | and siz|ing.}..k|
|00001310| 53 63 72 6f 6c 6c 62 61 | 72 57 69 64 74 68 09 09 |Scrollba|rWidth..|
|00001320| 09 3d 20 31 36 3b 0d 09 | 6b 53 63 72 6f 6c 6c 62 |.= 16;..|kScrollb|
|00001330| 61 72 41 64 6a 75 73 74 | 09 09 3d 20 6b 53 63 72 |arAdjust|..= kScr|
|00001340| 6f 6c 6c 62 61 72 57 69 | 64 74 68 20 2d 20 31 3b |ollbarWi|dth - 1;|
|00001350| 0d 09 0d 09 7b 6b 53 63 | 72 6f 6c 6c 54 77 65 65 |....{kSc|rollTwee|
|00001360| 6b 20 63 6f 6d 70 65 6e | 73 61 74 65 73 20 66 6f |k compen|sates fo|
|00001370| 72 20 6f 66 66 2d 62 79 | 2d 6f 6e 65 20 72 65 71 |r off-by|-one req|
|00001380| 75 69 72 65 6d 65 6e 74 | 73 20 6f 66 20 74 68 65 |uirement|s of the|
|00001390| 20 73 63 72 6f 6c 6c 62 | 61 72 73 0d 20 09 74 6f | scrollb|ars. .to|
|000013a0| 20 68 61 76 65 20 62 6f | 72 64 65 72 73 20 63 6f | have bo|rders co|
|000013b0| 69 6e 63 69 64 65 20 77 | 69 74 68 20 74 68 65 20 |incide w|ith the |
|000013c0| 67 72 6f 77 62 6f 78 2e | 7d 0d 09 6b 53 63 72 6f |growbox.|}..kScro|
|000013d0| 6c 6c 54 77 65 65 6b 09 | 09 09 3d 20 32 3b 0d 09 |llTweek.|..= 2;..|
|000013e0| 0d 09 7b 6b 43 72 43 68 | 61 72 20 69 73 20 75 73 |..{kCrCh|ar is us|
|000013f0| 65 64 20 74 6f 20 6d 61 | 74 63 68 20 77 69 74 68 |ed to ma|tch with|
|00001400| 20 61 20 63 61 72 72 69 | 61 67 65 20 72 65 74 75 | a carri|age retu|
|00001410| 72 6e 20 77 68 65 6e 20 | 63 61 6c 63 75 6c 61 74 |rn when |calculat|
|00001420| 69 6e 67 20 74 68 65 0d | 09 6e 75 6d 62 65 72 20 |ing the.|.number |
|00001430| 6f 66 20 6c 69 6e 65 73 | 20 69 6e 20 74 68 65 20 |of lines| in the |
|00001440| 54 65 78 74 45 64 69 74 | 20 72 65 63 6f 72 64 2e |TextEdit| record.|
|00001450| 20 6b 44 65 6c 43 68 61 | 72 20 69 73 20 75 73 65 | kDelCha|r is use|
|00001460| 64 20 74 6f 20 63 68 65 | 63 6b 20 66 6f 72 0d 09 |d to che|ck for..|
|00001470| 64 65 6c 65 74 65 20 69 | 6e 20 6b 65 79 44 6f 77 |delete i|n keyDow|
|00001480| 6e 73 2e 7d 0d 09 6b 43 | 52 43 68 61 72 09 09 09 |ns.}..kC|RChar...|
|00001490| 09 09 3d 20 31 33 3b 0d | 09 6b 44 65 6c 43 68 61 |..= 13;.|.kDelCha|
|000014a0| 72 09 09 09 09 3d 20 38 | 3b 0d 09 0d 09 7b 6b 42 |r....= 8|;....{kB|
|000014b0| 75 74 74 6f 6e 53 63 72 | 6f 6c 6c 20 69 73 20 68 |uttonScr|oll is h|
|000014c0| 6f 77 20 6d 61 6e 79 20 | 70 69 78 65 6c 73 20 74 |ow many |pixels t|
|000014d0| 6f 20 73 63 72 6f 6c 6c | 20 68 6f 72 69 7a 6f 6e |o scroll| horizon|
|000014e0| 74 61 6c 6c 79 20 77 68 | 65 6e 20 74 68 65 20 62 |tally wh|en the b|
|000014f0| 75 74 74 6f 6e 20 70 61 | 72 74 0d 09 6f 66 20 74 |utton pa|rt..of t|
|00001500| 68 65 20 68 6f 72 69 7a | 6f 6e 74 61 6c 20 73 63 |he horiz|ontal sc|
|00001510| 72 6f 6c 6c 62 61 72 20 | 69 73 20 70 72 65 73 73 |rollbar |is press|
|00001520| 65 64 2e 7d 0d 09 6b 42 | 75 74 74 6f 6e 53 63 72 |ed.}..kB|uttonScr|
|00001530| 6f 6c 6c 09 09 09 3d 20 | 34 3b 0d 09 0d 09 7b 6b |oll...= |4;....{k|
|00001540| 4d 61 78 54 45 4c 65 6e | 67 74 68 20 69 73 20 61 |MaxTELen|gth is a|
|00001550| 6e 20 61 72 62 69 74 72 | 61 72 79 20 6e 75 6d 62 |n arbitr|ary numb|
|00001560| 65 72 20 75 73 65 64 20 | 74 6f 20 6c 69 6d 69 74 |er used |to limit|
|00001570| 20 74 68 65 20 6c 65 6e | 67 74 68 20 6f 66 20 74 | the len|gth of t|
|00001580| 65 78 74 20 69 6e 20 74 | 68 65 20 54 45 52 65 63 |ext in t|he TERec|
|00001590| 0d 09 73 6f 20 74 68 61 | 74 20 76 61 72 69 6f 75 |..so tha|t variou|
|000015a0| 73 20 65 72 72 6f 72 73 | 20 77 6f 6e 27 74 20 6f |s errors| won't o|
|000015b0| 63 63 75 72 20 66 72 6f | 6d 20 74 6f 6f 20 6d 61 |ccur fro|m too ma|
|000015c0| 6e 79 20 63 68 61 72 61 | 63 74 65 72 73 20 69 6e |ny chara|cters in|
|000015d0| 20 74 68 65 20 74 65 78 | 74 2e 7d 0d 09 6b 4d 61 | the tex|t.}..kMa|
|000015e0| 78 54 45 4c 65 6e 67 74 | 68 09 09 09 3d 20 33 32 |xTELengt|h...= 32|
|000015f0| 30 30 30 3b 0d 0d 09 7b | 6b 53 79 73 45 6e 76 69 |000;...{|kSysEnvi|
|00001600| 72 6f 6e 73 56 65 72 73 | 69 6f 6e 20 69 73 20 70 |ronsVers|ion is p|
|00001610| 61 73 73 65 64 20 74 6f | 20 53 79 73 45 6e 76 69 |assed to| SysEnvi|
|00001620| 72 6f 6e 73 20 74 6f 20 | 74 65 6c 6c 20 69 74 20 |rons to |tell it |
|00001630| 77 68 69 63 68 20 76 65 | 72 73 69 6f 6e 20 6f 66 |which ve|rsion of|
|00001640| 20 74 68 65 0d 09 20 53 | 79 73 45 6e 76 52 65 63 | the.. S|ysEnvRec|
|00001650| 20 77 65 20 75 6e 64 65 | 72 73 74 61 6e 64 2e 7d | we unde|rstand.}|
|00001660| 0d 09 6b 53 79 73 45 6e | 76 69 72 6f 6e 73 56 65 |..kSysEn|vironsVe|
|00001670| 72 73 69 6f 6e 09 09 3d | 20 31 3b 0d 0d 09 7b 6b |rsion..=| 1;...{k|
|00001680| 4f 53 45 76 65 6e 74 20 | 69 73 20 74 68 65 20 65 |OSEvent |is the e|
|00001690| 76 65 6e 74 20 6e 75 6d | 62 65 72 20 6f 66 20 74 |vent num|ber of t|
|000016a0| 68 65 20 73 75 73 70 65 | 6e 64 2f 72 65 73 75 6d |he suspe|nd/resum|
|000016b0| 65 20 61 6e 64 20 6d 6f | 75 73 65 2d 6d 6f 76 65 |e and mo|use-move|
|000016c0| 64 20 65 76 65 6e 74 73 | 20 73 65 6e 74 0d 09 20 |d events| sent.. |
|000016d0| 62 79 20 4d 75 6c 74 69 | 46 69 6e 64 65 72 2e 20 |by Multi|Finder. |
|000016e0| 4f 6e 63 65 20 77 65 20 | 64 65 74 65 72 6d 69 6e |Once we |determin|
|000016f0| 65 20 74 68 61 74 20 61 | 6e 20 65 76 65 6e 74 20 |e that a|n event |
|00001700| 69 73 20 61 6e 20 6f 73 | 45 76 65 6e 74 2c 20 77 |is an os|Event, w|
|00001710| 65 20 6c 6f 6f 6b 20 61 | 74 20 74 68 65 0d 09 20 |e look a|t the.. |
|00001720| 68 69 67 68 20 62 79 74 | 65 20 6f 66 20 74 68 65 |high byt|e of the|
|00001730| 20 6d 65 73 73 61 67 65 | 20 73 65 6e 74 20 74 6f | message| sent to|
|00001740| 20 64 65 74 65 72 6d 69 | 6e 65 20 77 68 69 63 68 | determi|ne which|
|00001750| 20 6b 69 6e 64 20 69 74 | 20 69 73 2e 20 54 6f 20 | kind it| is. To |
|00001760| 64 69 66 66 65 72 65 6e | 74 69 61 74 65 0d 09 20 |differen|tiate.. |
|00001770| 73 75 73 70 65 6e 64 20 | 61 6e 64 20 72 65 73 75 |suspend |and resu|
|00001780| 6d 65 20 65 76 65 6e 74 | 73 20 77 65 20 63 68 65 |me event|s we che|
|00001790| 63 6b 20 74 68 65 20 72 | 65 73 75 6d 65 4d 61 73 |ck the r|esumeMas|
|000017a0| 6b 20 62 69 74 2e 7d 0d | 09 6b 4f 53 45 76 65 6e |k bit.}.|.kOSEven|
|000017b0| 74 09 09 09 09 3d 20 61 | 70 70 34 45 76 74 3b 09 |t....= a|pp4Evt;.|
|000017c0| 7b 65 76 65 6e 74 20 75 | 73 65 64 20 62 79 20 4d |{event u|sed by M|
|000017d0| 75 6c 74 69 46 69 6e 64 | 65 72 7d 0d 09 6b 53 75 |ultiFind|er}..kSu|
|000017e0| 73 70 65 6e 64 52 65 73 | 75 6d 65 4d 65 73 73 61 |spendRes|umeMessa|
|000017f0| 67 65 09 3d 20 31 3b 09 | 09 7b 68 69 67 68 20 62 |ge.= 1;.|.{high b|
|00001800| 79 74 65 20 6f 66 20 73 | 75 73 70 65 6e 64 2f 72 |yte of s|uspend/r|
|00001810| 65 73 75 6d 65 20 65 76 | 65 6e 74 20 6d 65 73 73 |esume ev|ent mess|
|00001820| 61 67 65 7d 0d 09 6b 52 | 65 73 75 6d 65 4d 61 73 |age}..kR|esumeMas|
|00001830| 6b 09 09 09 09 3d 20 31 | 3b 09 09 7b 62 69 74 20 |k....= 1|;..{bit |
|00001840| 6f 66 20 6d 65 73 73 61 | 67 65 20 66 69 65 6c 64 |of messa|ge field|
|00001850| 20 66 6f 72 20 72 65 73 | 75 6d 65 20 76 73 2e 20 | for res|ume vs. |
|00001860| 73 75 73 70 65 6e 64 7d | 0d 09 6b 4d 6f 75 73 65 |suspend}|..kMouse|
|00001870| 4d 6f 76 65 64 4d 65 73 | 73 61 67 65 09 09 3d 20 |MovedMes|sage..= |
|00001880| 24 46 41 3b 09 09 7b 68 | 69 67 68 20 62 79 74 65 |$FA;..{h|igh byte|
|00001890| 20 6f 66 20 6d 6f 75 73 | 65 2d 6d 6f 76 65 64 20 | of mous|e-moved |
|000018a0| 65 76 65 6e 74 20 6d 65 | 73 73 61 67 65 7d 0d 0d |event me|ssage}..|
|000018b0| 09 7b 31 2e 30 31 20 2d | 20 6b 4d 69 6e 48 65 61 |.{1.01 -| kMinHea|
|000018c0| 70 20 2d 20 54 68 69 73 | 20 69 73 20 74 68 65 20 |p - This| is the |
|000018d0| 6d 69 6e 69 6d 75 6d 20 | 72 65 73 75 6c 74 20 66 |minimum |result f|
|000018e0| 72 6f 6d 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |rom the |followin|
|000018f0| 67 0d 09 20 65 71 75 61 | 74 69 6f 6e 3a 0d 09 09 |g.. equa|tion:...|
|00001900| 09 0d 09 09 09 4f 52 44 | 28 47 65 74 41 70 70 6c |.....ORD|(GetAppl|
|00001910| 4c 69 6d 69 74 29 20 2d | 20 4f 52 44 28 41 70 70 |Limit) -| ORD(App|
|00001920| 6c 69 63 5a 6f 6e 65 29 | 0d 09 09 09 0d 09 20 66 |licZone)|...... f|
|00001930| 6f 72 20 74 68 65 20 61 | 70 70 6c 69 63 61 74 69 |or the a|pplicati|
|00001940| 6f 6e 20 74 6f 20 72 75 | 6e 2e 20 49 74 20 77 69 |on to ru|n. It wi|
|00001950| 6c 6c 20 69 6e 73 75 72 | 65 20 74 68 61 74 20 65 |ll insur|e that e|
|00001960| 6e 6f 75 67 68 20 6d 65 | 6d 6f 72 79 20 77 69 6c |nough me|mory wil|
|00001970| 6c 0d 09 20 62 65 20 61 | 72 6f 75 6e 64 20 66 6f |l.. be a|round fo|
|00001980| 72 20 72 65 61 73 6f 6e | 61 62 6c 65 2d 73 69 7a |r reason|able-siz|
|00001990| 65 64 20 73 63 72 61 70 | 73 2c 20 46 4b 45 59 73 |ed scrap|s, FKEYs|
|000019a0| 2c 20 65 74 63 2e 20 74 | 6f 20 65 78 69 73 74 20 |, etc. t|o exist |
|000019b0| 77 69 74 68 20 74 68 65 | 0d 09 20 61 70 70 6c 69 |with the|.. appli|
|000019c0| 63 61 74 69 6f 6e 2c 20 | 61 6e 64 20 73 74 69 6c |cation, |and stil|
|000019d0| 6c 20 67 69 76 65 20 74 | 68 65 20 61 70 70 6c 69 |l give t|he appli|
|000019e0| 63 61 74 69 6f 6e 20 73 | 6f 6d 65 20 27 62 72 65 |cation s|ome 'bre|
|000019f0| 61 74 68 69 6e 67 20 72 | 6f 6f 6d 27 2e 0d 09 20 |athing r|oom'... |
|00001a00| 54 6f 20 64 65 72 69 76 | 65 20 74 68 69 73 20 6e |To deriv|e this n|
|00001a10| 75 6d 62 65 72 2c 20 77 | 65 20 72 61 6e 20 75 6e |umber, w|e ran un|
|00001a20| 64 65 72 20 61 20 4d 75 | 6c 74 69 46 69 6e 64 65 |der a Mu|ltiFinde|
|00001a30| 72 20 70 61 72 74 69 74 | 69 6f 6e 20 74 68 61 74 |r partit|ion that|
|00001a40| 20 77 61 73 0d 09 20 6f | 75 72 20 72 65 71 75 65 | was.. o|ur reque|
|00001a50| 73 74 65 64 20 6d 69 6e | 69 6d 75 6d 20 73 69 7a |sted min|imum siz|
|00001a60| 65 2c 20 61 73 20 67 69 | 76 65 6e 20 69 6e 20 74 |e, as gi|ven in t|
|00001a70| 68 65 20 27 53 49 5a 45 | 27 20 72 65 73 6f 75 72 |he 'SIZE|' resour|
|00001a80| 63 65 2e 7d 0d 09 20 0d | 09 6b 4d 69 6e 48 65 61 |ce.}.. .|.kMinHea|
|00001a90| 70 09 3d 20 32 39 20 2a | 20 31 30 32 34 3b 0d 09 |p.= 29 *| 1024;..|
|00001aa0| 0d 09 7b 31 2e 30 31 20 | 2d 20 6b 4d 69 6e 53 70 |..{1.01 |- kMinSp|
|00001ab0| 61 63 65 20 2d 20 54 68 | 69 73 20 69 73 20 74 68 |ace - Th|is is th|
|00001ac0| 65 20 6d 69 6e 69 6d 75 | 6d 20 72 65 73 75 6c 74 |e minimu|m result|
|00001ad0| 20 66 72 6f 6d 20 50 75 | 72 67 65 53 70 61 63 65 | from Pu|rgeSpace|
|00001ae0| 2c 20 77 68 65 6e 20 63 | 61 6c 6c 65 64 0d 09 20 |, when c|alled.. |
|00001af0| 61 74 20 69 6e 69 74 69 | 61 6c 69 7a 61 74 69 6f |at initi|alizatio|
|00001b00| 6e 20 74 69 6d 65 2c 20 | 66 6f 72 20 74 68 65 20 |n time, |for the |
|00001b10| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 74 6f 20 72 |applicat|ion to r|
|00001b20| 75 6e 2e 20 54 68 69 73 | 20 6e 75 6d 62 65 72 20 |un. This| number |
|00001b30| 61 63 74 73 0d 09 20 61 | 73 20 61 20 64 6f 75 62 |acts.. a|s a doub|
|00001b40| 6c 65 2d 63 68 65 63 6b | 20 74 6f 20 69 6e 73 75 |le-check| to insu|
|00001b50| 72 65 20 74 68 61 74 20 | 74 68 65 72 65 20 72 65 |re that |there re|
|00001b60| 61 6c 6c 79 20 69 73 20 | 65 6e 6f 75 67 68 20 6d |ally is |enough m|
|00001b70| 65 6d 6f 72 79 20 66 6f | 72 20 74 68 65 0d 09 20 |emory fo|r the.. |
|00001b80| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 74 6f 20 72 |applicat|ion to r|
|00001b90| 75 6e 2c 20 69 6e 63 6c | 75 64 69 6e 67 20 77 68 |un, incl|uding wh|
|00001ba0| 61 74 20 68 61 73 20 62 | 65 65 6e 20 74 61 6b 65 |at has b|een take|
|00001bb0| 6e 20 75 70 20 61 6c 72 | 65 61 64 79 20 62 79 0d |n up alr|eady by.|
|00001bc0| 09 20 70 72 65 2d 6c 6f | 61 64 65 64 20 72 65 73 |. pre-lo|aded res|
|00001bd0| 6f 75 72 63 65 73 2c 20 | 74 68 65 20 73 63 72 61 |ources, |the scra|
|00001be0| 70 2c 20 63 6f 64 65 2c | 20 61 6e 64 20 6f 74 68 |p, code,| and oth|
|00001bf0| 65 72 20 73 75 6e 64 72 | 79 20 6d 65 6d 6f 72 79 |er sundr|y memory|
|00001c00| 20 62 6c 6f 63 6b 73 2e | 7d 0d 09 20 0d 09 6b 4d | blocks.|}.. ..kM|
|00001c10| 69 6e 53 70 61 63 65 09 | 3d 20 32 30 20 2a 20 31 |inSpace.|= 20 * 1|
|00001c20| 30 32 34 3b 0d 09 0d 09 | 7b 6b 45 78 74 72 65 6d |024;....|{kExtrem|
|00001c30| 65 4e 65 67 20 61 6e 64 | 20 6b 45 78 74 72 65 6d |eNeg and| kExtrem|
|00001c40| 65 50 6f 73 20 61 72 65 | 20 75 73 65 64 20 74 6f |ePos are| used to|
|00001c50| 20 73 65 74 20 75 70 20 | 77 69 64 65 20 6f 70 65 | set up |wide ope|
|00001c60| 6e 20 72 65 63 74 61 6e | 67 6c 65 73 20 61 6e 64 |n rectan|gles and|
|00001c70| 20 72 65 67 69 6f 6e 73 | 2e 7d 0d 09 6b 45 78 74 | regions|.}..kExt|
|00001c80| 72 65 6d 65 4e 65 67 09 | 09 3d 20 2d 33 32 37 36 |remeNeg.|.= -3276|
|00001c90| 38 3b 0d 09 6b 45 78 74 | 72 65 6d 65 50 6f 73 09 |8;..kExt|remePos.|
|00001ca0| 09 3d 20 33 32 37 36 37 | 20 2d 20 31 3b 09 7b 72 |.= 32767| - 1;.{r|
|00001cb0| 65 71 75 69 72 65 64 20 | 66 6f 72 20 6f 6c 64 20 |equired |for old |
|00001cc0| 72 65 67 69 6f 6e 20 62 | 75 67 7d 0d 09 0d 09 7b |region b|ug}....{|
|00001cd0| 6b 54 45 53 6c 6f 70 20 | 70 72 6f 76 69 64 65 73 |kTESlop |provides|
|00001ce0| 20 73 6f 6d 65 20 65 78 | 74 72 61 20 73 65 63 75 | some ex|tra secu|
|00001cf0| 72 69 74 79 20 77 68 65 | 6e 20 70 72 65 2d 66 6c |rity whe|n pre-fl|
|00001d00| 69 67 68 74 69 6e 67 20 | 65 64 69 74 20 63 6f 6d |ighting |edit com|
|00001d10| 6d 61 6e 64 73 2e 7d 0d | 09 6b 54 45 53 6c 6f 70 |mands.}.|.kTESlop|
|00001d20| 09 09 09 3d 20 31 30 32 | 34 3b 0d 0d 09 7b 6b 45 |...= 102|4;...{kE|
|00001d30| 72 72 53 74 72 69 6e 67 | 73 20 69 73 20 74 68 65 |rrString|s is the|
|00001d40| 20 72 65 73 6f 75 72 63 | 65 20 49 44 20 66 6f 72 | resourc|e ID for|
|00001d50| 20 74 68 65 20 65 72 72 | 6f 72 20 73 74 72 69 6e | the err|or strin|
|00001d60| 67 73 20 53 54 52 23 20 | 72 65 73 6f 75 72 63 65 |gs STR# |resource|
|00001d70| 2e 7d 0d 09 6b 45 72 72 | 53 74 72 69 6e 67 73 09 |.}..kErr|Strings.|
|00001d80| 09 3d 20 31 32 38 3b 0d | 0d 09 7b 54 68 65 20 66 |.= 128;.|..{The f|
|00001d90| 6f 6c 6c 6f 77 69 6e 67 | 20 61 72 65 20 69 6e 64 |ollowing| are ind|
|00001da0| 69 63 69 65 73 20 69 6e | 74 6f 20 53 54 52 23 20 |icies in|to STR# |
|00001db0| 72 65 73 6f 75 72 63 65 | 73 2e 7d 0d 09 65 57 72 |resource|s.}..eWr|
|00001dc0| 6f 6e 67 4d 61 63 68 69 | 6e 65 09 3d 20 31 3b 0d |ongMachi|ne.= 1;.|
|00001dd0| 09 65 53 6d 61 6c 6c 53 | 69 7a 65 09 09 3d 20 32 |.eSmallS|ize..= 2|
|00001de0| 3b 0d 09 65 4e 6f 4d 65 | 6d 6f 72 79 09 09 3d 20 |;..eNoMe|mory..= |
|00001df0| 33 3b 0d 09 65 4e 6f 53 | 70 61 63 65 43 75 74 09 |3;..eNoS|paceCut.|
|00001e00| 09 3d 20 34 3b 0d 09 65 | 4e 6f 43 75 74 09 09 09 |.= 4;..e|NoCut...|
|00001e10| 3d 20 35 3b 0d 09 65 4e | 6f 43 6f 70 79 09 09 09 |= 5;..eN|oCopy...|
|00001e20| 3d 20 36 3b 0d 09 65 45 | 78 63 65 65 64 50 61 73 |= 6;..eE|xceedPas|
|00001e30| 74 65 09 3d 20 37 3b 0d | 09 65 4e 6f 53 70 61 63 |te.= 7;.|.eNoSpac|
|00001e40| 65 50 61 73 74 65 09 3d | 20 38 3b 0d 09 65 4e 6f |ePaste.=| 8;..eNo|
|00001e50| 57 69 6e 64 6f 77 09 09 | 3d 20 39 3b 0d 09 65 45 |Window..|= 9;..eE|
|00001e60| 78 63 65 65 64 43 68 61 | 72 09 09 3d 20 31 30 3b |xceedCha|r..= 10;|
|00001e70| 0d 09 65 4e 6f 50 61 73 | 74 65 09 09 3d 20 31 31 |..eNoPas|te..= 11|
|00001e80| 3b 0d 09 0d 09 7b 54 68 | 65 20 66 6f 6c 6c 6f 77 |;....{Th|e follow|
|00001e90| 69 6e 67 20 63 6f 6e 73 | 74 61 6e 74 73 20 61 72 |ing cons|tants ar|
|00001ea0| 65 20 61 6c 6c 20 72 65 | 73 6f 75 72 63 65 20 49 |e all re|source I|
|00001eb0| 44 73 2c 20 63 6f 72 72 | 65 73 70 6f 6e 64 69 6e |Ds, corr|espondin|
|00001ec0| 67 20 74 6f 20 72 65 73 | 6f 75 72 63 65 73 20 69 |g to res|ources i|
|00001ed0| 6e 20 53 61 6d 70 6c 65 | 2e 72 2e 7d 0d 09 72 4d |n Sample|.r.}..rM|
|00001ee0| 65 6e 75 42 61 72 09 3d | 20 31 32 38 3b 09 09 09 |enuBar.=| 128;...|
|00001ef0| 09 09 7b 61 70 70 6c 69 | 63 61 74 69 6f 6e 27 73 |..{appli|cation's|
|00001f00| 20 6d 65 6e 75 20 62 61 | 72 7d 0d 09 72 41 62 6f | menu ba|r}..rAbo|
|00001f10| 75 74 41 6c 65 72 74 09 | 3d 20 31 32 38 3b 09 09 |utAlert.|= 128;..|
|00001f20| 09 09 09 7b 61 62 6f 75 | 74 20 61 6c 65 72 74 7d |...{abou|t alert}|
|00001f30| 0d 09 72 55 73 65 72 41 | 6c 65 72 74 09 3d 20 31 |..rUserA|lert.= 1|
|00001f40| 32 39 3b 09 09 09 09 09 | 7b 75 73 65 72 20 65 72 |29;.....|{user er|
|00001f50| 72 6f 72 20 61 6c 65 72 | 74 7d 0d 09 72 44 6f 63 |ror aler|t}..rDoc|
|00001f60| 57 69 6e 64 6f 77 09 3d | 20 31 32 38 3b 09 09 09 |Window.=| 128;...|
|00001f70| 09 09 7b 61 70 70 6c 69 | 63 61 74 69 6f 6e 27 73 |..{appli|cation's|
|00001f80| 20 77 69 6e 64 6f 77 7d | 0d 09 72 56 53 63 72 6f | window}|..rVScro|
|00001f90| 6c 6c 09 3d 20 31 32 38 | 3b 09 09 09 09 09 7b 76 |ll.= 128|;.....{v|
|00001fa0| 65 72 74 69 63 61 6c 20 | 73 63 72 6f 6c 6c 62 61 |ertical |scrollba|
|00001fb0| 72 20 63 6f 6e 74 72 6f | 6c 7d 0d 09 72 48 53 63 |r contro|l}..rHSc|
|00001fc0| 72 6f 6c 6c 09 3d 20 31 | 32 39 3b 09 09 09 09 09 |roll.= 1|29;.....|
|00001fd0| 7b 68 6f 72 69 7a 6f 6e | 74 61 6c 20 73 63 72 6f |{horizon|tal scro|
|00001fe0| 6c 6c 62 61 72 20 63 6f | 6e 74 72 6f 6c 7d 0d 0d |llbar co|ntrol}..|
|00001ff0| 09 7b 54 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |.{The fo|llowing |
|00002000| 63 6f 6e 73 74 61 6e 74 | 73 20 61 72 65 20 75 73 |constant|s are us|
|00002010| 65 64 20 74 6f 20 69 64 | 65 6e 74 69 66 79 20 6d |ed to id|entify m|
|00002020| 65 6e 75 73 20 61 6e 64 | 20 74 68 65 69 72 20 69 |enus and| their i|
|00002030| 74 65 6d 73 2e 20 54 68 | 65 20 6d 65 6e 75 20 49 |tems. Th|e menu I|
|00002040| 44 73 0d 09 20 68 61 76 | 65 20 61 6e 20 22 6d 22 |Ds.. hav|e an "m"|
|00002050| 20 70 72 65 66 69 78 20 | 61 6e 64 20 74 68 65 20 | prefix |and the |
|00002060| 69 74 65 6d 20 6e 75 6d | 62 65 72 73 20 77 69 74 |item num|bers wit|
|00002070| 68 69 6e 20 65 61 63 68 | 20 6d 65 6e 75 20 68 61 |hin each| menu ha|
|00002080| 76 65 20 61 6e 20 22 69 | 22 20 70 72 65 66 69 78 |ve an "i|" prefix|
|00002090| 2e 7d 0d 09 6d 41 70 70 | 6c 65 09 09 3d 20 31 32 |.}..mApp|le..= 12|
|000020a0| 38 3b 09 09 09 09 09 7b | 41 70 70 6c 65 20 6d 65 |8;.....{|Apple me|
|000020b0| 6e 75 7d 0d 09 69 41 62 | 6f 75 74 09 09 3d 20 31 |nu}..iAb|out..= 1|
|000020c0| 3b 0d 0d 09 6d 46 69 6c | 65 09 09 3d 20 31 32 39 |;...mFil|e..= 129|
|000020d0| 3b 09 09 09 09 09 7b 46 | 69 6c 65 20 6d 65 6e 75 |;.....{F|ile menu|
|000020e0| 7d 0d 09 69 4e 65 77 09 | 09 3d 20 31 3b 0d 09 69 |}..iNew.|.= 1;..i|
|000020f0| 43 6c 6f 73 65 09 09 3d | 20 34 3b 0d 09 69 51 75 |Close..=| 4;..iQu|
|00002100| 69 74 09 09 3d 20 31 32 | 3b 0d 0d 09 6d 45 64 69 |it..= 12|;...mEdi|
|00002110| 74 09 09 3d 20 31 33 30 | 3b 09 09 09 09 09 7b 45 |t..= 130|;.....{E|
|00002120| 64 69 74 20 6d 65 6e 75 | 7d 0d 09 69 55 6e 64 6f |dit menu|}..iUndo|
|00002130| 09 09 3d 20 31 3b 0d 09 | 69 43 75 74 09 09 3d 20 |..= 1;..|iCut..= |
|00002140| 33 3b 0d 09 69 43 6f 70 | 79 09 09 3d 20 34 3b 0d |3;..iCop|y..= 4;.|
|00002150| 09 69 50 61 73 74 65 09 | 09 3d 20 35 3b 0d 09 69 |.iPaste.|.= 5;..i|
|00002160| 43 6c 65 61 72 09 09 3d | 20 36 3b 0d 0d 09 7b 31 |Clear..=| 6;...{1|
|00002170| 2e 30 31 20 2d 20 6b 44 | 49 54 6f 70 20 61 6e 64 |.01 - kD|ITop and|
|00002180| 20 6b 44 49 4c 65 66 74 | 20 61 72 65 20 75 73 65 | kDILeft| are use|
|00002190| 64 20 74 6f 20 6c 6f 63 | 61 74 65 20 74 68 65 20 |d to loc|ate the |
|000021a0| 44 69 73 6b 20 49 6e 69 | 74 69 61 6c 69 7a 61 74 |Disk Ini|tializat|
|000021b0| 69 6f 6e 20 64 69 61 6c | 6f 67 73 2e 7d 0d 09 6b |ion dial|ogs.}..k|
|000021c0| 44 49 54 6f 70 09 09 3d | 20 24 30 30 35 30 3b 0d |DITop..=| $0050;.|
|000021d0| 09 6b 44 49 4c 65 66 74 | 09 09 3d 20 24 30 30 37 |.kDILeft|..= $007|
|000021e0| 30 3b 0d 0d 0d 54 59 50 | 45 0d 09 7b 41 20 44 6f |0;...TYP|E..{A Do|
|000021f0| 63 75 6d 65 6e 74 52 65 | 63 6f 72 64 20 63 6f 6e |cumentRe|cord con|
|00002200| 74 61 69 6e 73 20 74 68 | 65 20 57 69 6e 64 6f 77 |tains th|e Window|
|00002210| 52 65 63 6f 72 64 20 66 | 6f 72 20 6f 6e 65 20 6f |Record f|or one o|
|00002220| 66 20 6f 75 72 20 64 6f | 63 75 6d 65 6e 74 20 77 |f our do|cument w|
|00002230| 69 6e 64 6f 77 73 2c 0d | 09 20 61 73 20 77 65 6c |indows,.|. as wel|
|00002240| 6c 20 61 73 20 74 68 65 | 20 54 45 48 61 6e 64 6c |l as the| TEHandl|
|00002250| 65 20 66 6f 72 20 74 68 | 65 20 74 65 78 74 20 77 |e for th|e text w|
|00002260| 65 20 61 72 65 20 65 64 | 69 74 69 6e 67 2e 20 57 |e are ed|iting. W|
|00002270| 65 20 68 61 76 65 20 61 | 64 64 65 64 20 66 69 65 |e have a|dded fie|
|00002280| 6c 64 73 20 74 6f 0d 09 | 20 68 6f 6c 64 20 74 68 |lds to..| hold th|
|00002290| 65 20 43 6f 6e 74 72 6f | 6c 48 61 6e 64 6c 65 73 |e Contro|lHandles|
|000022a0| 20 74 6f 20 74 68 65 20 | 76 65 72 74 69 63 61 6c | to the |vertical|
|000022b0| 20 61 6e 64 20 68 6f 72 | 69 7a 6f 6e 74 61 6c 20 | and hor|izontal |
|000022c0| 73 63 72 6f 6c 6c 62 61 | 72 73 20 61 6e 64 20 74 |scrollba|rs and t|
|000022d0| 6f 20 68 6f 6c 64 0d 09 | 20 74 68 65 20 61 64 64 |o hold..| the add|
|000022e0| 72 65 73 73 20 6f 66 20 | 74 68 65 20 64 65 66 61 |ress of |the defa|
|000022f0| 75 6c 74 20 63 6c 69 6b | 4c 6f 6f 70 20 74 68 61 |ult clik|Loop tha|
|00002300| 74 20 67 65 74 73 20 61 | 74 74 61 63 68 65 64 20 |t gets a|ttached |
|00002310| 74 6f 20 61 20 54 45 52 | 65 63 20 77 68 65 6e 20 |to a TER|ec when |
|00002320| 79 6f 75 20 63 61 6c 6c | 0d 09 20 54 45 41 75 74 |you call|.. TEAut|
|00002330| 6f 56 69 65 77 2e 20 4f | 74 68 65 72 20 64 6f 63 |oView. O|ther doc|
|00002340| 75 6d 65 6e 74 20 66 69 | 65 6c 64 73 20 63 61 6e |ument fi|elds can|
|00002350| 20 62 65 20 61 64 64 65 | 64 20 74 6f 20 74 68 69 | be adde|d to thi|
|00002360| 73 20 72 65 63 6f 72 64 | 20 61 73 20 6e 65 65 64 |s record| as need|
|00002370| 65 64 2e 20 46 6f 72 0d | 09 20 61 20 73 69 6d 69 |ed. For.|. a simi|
|00002380| 6c 61 72 20 65 78 61 6d | 70 6c 65 2c 20 73 65 65 |lar exam|ple, see|
|00002390| 20 68 6f 77 20 74 68 65 | 20 57 69 6e 64 6f 77 20 | how the| Window |
|000023a0| 4d 61 6e 61 67 65 72 20 | 61 6e 64 20 44 69 61 6c |Manager |and Dial|
|000023b0| 6f 67 20 4d 61 6e 61 67 | 65 72 20 61 64 64 20 66 |og Manag|er add f|
|000023c0| 69 65 6c 64 73 0d 09 20 | 61 66 74 65 72 20 74 68 |ields.. |after th|
|000023d0| 65 20 47 72 61 66 50 6f | 72 74 2e 7d 0d 09 44 6f |e GrafPo|rt.}..Do|
|000023e0| 63 75 6d 65 6e 74 52 65 | 63 6f 72 64 09 3d 20 52 |cumentRe|cord.= R|
|000023f0| 45 43 4f 52 44 0d 09 09 | 64 6f 63 57 69 6e 64 6f |ECORD...|docWindo|
|00002400| 77 09 3a 20 57 69 6e 64 | 6f 77 52 65 63 6f 72 64 |w.: Wind|owRecord|
|00002410| 3b 0d 09 09 64 6f 63 54 | 45 09 09 3a 20 54 45 48 |;...docT|E..: TEH|
|00002420| 61 6e 64 6c 65 3b 0d 09 | 09 64 6f 63 56 53 63 72 |andle;..|.docVScr|
|00002430| 6f 6c 6c 09 3a 20 43 6f | 6e 74 72 6f 6c 48 61 6e |oll.: Co|ntrolHan|
|00002440| 64 6c 65 3b 0d 09 09 64 | 6f 63 48 53 63 72 6f 6c |dle;...d|ocHScrol|
|00002450| 6c 09 3a 20 43 6f 6e 74 | 72 6f 6c 48 61 6e 64 6c |l.: Cont|rolHandl|
|00002460| 65 3b 0d 09 09 64 6f 63 | 43 6c 69 6b 09 09 3a 20 |e;...doc|Clik..: |
|00002470| 50 72 6f 63 50 74 72 3b | 0d 09 45 4e 44 3b 0d 09 |ProcPtr;|..END;..|
|00002480| 44 6f 63 75 6d 65 6e 74 | 50 65 65 6b 09 3d 20 5e |Document|Peek.= ^|
|00002490| 44 6f 63 75 6d 65 6e 74 | 52 65 63 6f 72 64 3b 0d |Document|Record;.|
|000024a0| 0d 0d 56 41 52 0d 09 7b | 54 68 65 20 22 67 22 20 |..VAR..{|The "g" |
|000024b0| 70 72 65 66 69 78 20 69 | 73 20 75 73 65 64 20 74 |prefix i|s used t|
|000024c0| 6f 20 65 6d 70 68 61 73 | 69 7a 65 20 74 68 61 74 |o emphas|ize that|
|000024d0| 20 61 20 76 61 72 69 61 | 62 6c 65 20 69 73 20 67 | a varia|ble is g|
|000024e0| 6c 6f 62 61 6c 2e 7d 0d | 0d 09 7b 47 4d 61 63 20 |lobal.}.|..{GMac |
|000024f0| 69 73 20 75 73 65 64 20 | 74 6f 20 68 6f 6c 64 20 |is used |to hold |
|00002500| 74 68 65 20 72 65 73 75 | 6c 74 20 6f 66 20 61 20 |the resu|lt of a |
|00002510| 53 79 73 45 6e 76 69 72 | 6f 6e 73 20 63 61 6c 6c |SysEnvir|ons call|
|00002520| 2e 20 54 68 69 73 20 6d | 61 6b 65 73 0d 09 20 69 |. This m|akes.. i|
|00002530| 74 20 63 6f 6e 76 65 6e | 69 65 6e 74 20 66 6f 72 |t conven|ient for|
|00002540| 20 61 6e 79 20 72 6f 75 | 74 69 6e 65 20 74 6f 20 | any rou|tine to |
|00002550| 63 68 65 63 6b 20 74 68 | 65 20 65 6e 76 69 72 6f |check th|e enviro|
|00002560| 6e 6d 65 6e 74 2e 20 49 | 74 20 69 73 0d 09 20 67 |nment. I|t is.. g|
|00002570| 6c 6f 62 61 6c 20 69 6e | 66 6f 72 6d 61 74 69 6f |lobal in|formatio|
|00002580| 6e 2c 20 61 6e 79 77 61 | 79 2e 7d 0d 09 67 4d 61 |n, anywa|y.}..gMa|
|00002590| 63 09 09 09 09 3a 20 53 | 79 73 45 6e 76 52 65 63 |c....: S|ysEnvRec|
|000025a0| 3b 09 7b 73 65 74 20 75 | 70 20 62 79 20 49 6e 69 |;.{set u|p by Ini|
|000025b0| 74 69 61 6c 69 7a 65 7d | 0d 0d 09 7b 47 48 61 73 |tialize}|...{GHas|
|000025c0| 57 61 69 74 4e 65 78 74 | 45 76 65 6e 74 20 69 73 |WaitNext|Event is|
|000025d0| 20 73 65 74 20 61 74 20 | 73 74 61 72 74 75 70 2c | set at |startup,|
|000025e0| 20 61 6e 64 20 74 65 6c | 6c 73 20 77 68 65 74 68 | and tel|ls wheth|
|000025f0| 65 72 20 74 68 65 20 57 | 61 69 74 4e 65 78 74 45 |er the W|aitNextE|
|00002600| 76 65 6e 74 0d 09 20 74 | 72 61 70 20 69 73 20 61 |vent.. t|rap is a|
|00002610| 76 61 69 6c 61 62 6c 65 | 2e 20 49 66 20 69 74 20 |vailable|. If it |
|00002620| 69 73 20 66 61 6c 73 65 | 2c 20 77 65 20 6b 6e 6f |is false|, we kno|
|00002630| 77 20 74 68 61 74 20 77 | 65 20 6d 75 73 74 20 63 |w that w|e must c|
|00002640| 61 6c 6c 20 47 65 74 4e | 65 78 74 45 76 65 6e 74 |all GetN|extEvent|
|00002650| 2e 7d 0d 09 67 48 61 73 | 57 61 69 74 4e 65 78 74 |.}..gHas|WaitNext|
|00002660| 45 76 65 6e 74 09 3a 20 | 42 4f 4f 4c 45 41 4e 3b |Event.: |BOOLEAN;|
|00002670| 09 09 7b 73 65 74 20 75 | 70 20 62 79 20 49 6e 69 |..{set u|p by Ini|
|00002680| 74 69 61 6c 69 7a 65 7d | 0d 0d 09 7b 47 49 6e 42 |tialize}|...{GInB|
|00002690| 61 63 6b 67 72 6f 75 6e | 64 20 69 73 20 6d 61 69 |ackgroun|d is mai|
|000026a0| 6e 74 61 69 6e 65 64 20 | 62 79 20 6f 75 72 20 4f |ntained |by our O|
|000026b0| 53 45 76 65 6e 74 20 68 | 61 6e 64 6c 69 6e 67 20 |SEvent h|andling |
|000026c0| 72 6f 75 74 69 6e 65 73 | 2e 20 41 6e 79 20 70 61 |routines|. Any pa|
|000026d0| 72 74 20 6f 66 0d 09 20 | 74 68 65 20 70 72 6f 67 |rt of.. |the prog|
|000026e0| 72 61 6d 20 63 61 6e 20 | 63 68 65 63 6b 20 69 74 |ram can |check it|
|000026f0| 20 74 6f 20 66 69 6e 64 | 20 6f 75 74 20 69 66 20 | to find| out if |
|00002700| 69 74 20 69 73 20 63 75 | 72 72 65 6e 74 6c 79 20 |it is cu|rrently |
|00002710| 69 6e 20 74 68 65 20 62 | 61 63 6b 67 72 6f 75 6e |in the b|ackgroun|
|00002720| 64 2e 7d 0d 09 67 49 6e | 42 61 63 6b 67 72 6f 75 |d.}..gIn|Backgrou|
|00002730| 6e 64 09 09 3a 20 42 4f | 4f 4c 45 41 4e 3b 09 09 |nd..: BO|OLEAN;..|
|00002740| 7b 6d 61 69 6e 74 61 69 | 6e 65 64 20 62 79 20 49 |{maintai|ned by I|
|00002750| 6e 69 74 69 61 6c 69 7a | 65 20 61 6e 64 20 44 6f |nitializ|e and Do|
|00002760| 45 76 65 6e 74 7d 0d 0d | 09 7b 47 4e 75 6d 44 6f |Event}..|.{GNumDo|
|00002770| 63 75 6d 65 6e 74 73 20 | 69 73 20 75 73 65 64 20 |cuments |is used |
|00002780| 74 6f 20 6b 65 65 70 20 | 74 72 61 63 6b 20 6f 66 |to keep |track of|
|00002790| 20 68 6f 77 20 6d 61 6e | 79 20 6f 70 65 6e 20 64 | how man|y open d|
|000027a0| 6f 63 75 6d 65 6e 74 73 | 20 74 68 65 72 65 20 61 |ocuments| there a|
|000027b0| 72 65 0d 09 20 61 74 20 | 61 6e 79 20 74 69 6d 65 |re.. at |any time|
|000027c0| 2e 20 49 74 20 69 73 20 | 6d 61 69 6e 74 61 69 6e |. It is |maintain|
|000027d0| 65 64 20 62 79 20 74 68 | 65 20 72 6f 75 74 69 6e |ed by th|e routin|
|000027e0| 65 73 20 74 68 61 74 20 | 6f 70 65 6e 20 61 6e 64 |es that |open and|
|000027f0| 20 63 6c 6f 73 65 20 64 | 6f 63 75 6d 65 6e 74 73 | close d|ocuments|
|00002800| 2e 7d 0d 09 67 4e 75 6d | 44 6f 63 75 6d 65 6e 74 |.}..gNum|Document|
|00002810| 73 09 09 3a 20 49 4e 54 | 45 47 45 52 3b 09 09 7b |s..: INT|EGER;..{|
|00002820| 6d 61 69 6e 74 61 69 6e | 65 64 20 62 79 20 49 6e |maintain|ed by In|
|00002830| 69 74 69 61 6c 69 7a 65 | 2c 20 44 6f 4e 65 77 2c |itialize|, DoNew,|
|00002840| 20 61 6e 64 20 44 6f 43 | 6c 6f 73 65 57 69 6e 64 | and DoC|loseWind|
|00002850| 6f 77 7d 0d 0d 09 0d 7b | 24 53 20 49 6e 69 74 69 |ow}....{|$S Initi|
|00002860| 61 6c 69 7a 65 7d 0d 46 | 55 4e 43 54 49 4f 4e 20 |alize}.F|UNCTION |
|00002870| 54 72 61 70 41 76 61 69 | 6c 61 62 6c 65 28 74 4e |TrapAvai|lable(tN|
|00002880| 75 6d 62 65 72 3a 20 49 | 4e 54 45 47 45 52 3b 20 |umber: I|NTEGER; |
|00002890| 74 54 79 70 65 3a 20 54 | 72 61 70 54 79 70 65 29 |tType: T|rapType)|
|000028a0| 3a 20 42 4f 4f 4c 45 41 | 4e 3b 0d 0d 7b 43 68 65 |: BOOLEA|N;..{Che|
|000028b0| 63 6b 20 74 6f 20 73 65 | 65 20 69 66 20 61 20 67 |ck to se|e if a g|
|000028c0| 69 76 65 6e 20 74 72 61 | 70 20 69 73 20 69 6d 70 |iven tra|p is imp|
|000028d0| 6c 65 6d 65 6e 74 65 64 | 2e 20 54 68 69 73 20 69 |lemented|. This i|
|000028e0| 73 20 6f 6e 6c 79 20 75 | 73 65 64 20 62 79 20 74 |s only u|sed by t|
|000028f0| 68 65 0d 20 49 6e 69 74 | 69 61 6c 69 7a 65 20 72 |he. Init|ialize r|
|00002900| 6f 75 74 69 6e 65 20 69 | 6e 20 74 68 69 73 20 70 |outine i|n this p|
|00002910| 72 6f 67 72 61 6d 2c 20 | 73 6f 20 77 65 20 70 75 |rogram, |so we pu|
|00002920| 74 20 69 74 20 69 6e 20 | 74 68 65 20 49 6e 69 74 |t it in |the Init|
|00002930| 69 61 6c 69 7a 65 20 73 | 65 67 6d 65 6e 74 2e 7d |ialize s|egment.}|
|00002940| 0d 0d 42 45 47 49 4e 0d | 09 7b 43 68 65 63 6b 20 |..BEGIN.|.{Check |
|00002950| 61 6e 64 20 73 65 65 20 | 69 66 20 74 68 65 20 74 |and see |if the t|
|00002960| 72 61 70 20 65 78 69 73 | 74 73 2e 20 4f 6e 20 36 |rap exis|ts. On 6|
|00002970| 34 4b 20 52 4f 4d 20 6d | 61 63 68 69 6e 65 73 2c |4K ROM m|achines,|
|00002980| 20 74 54 79 70 65 20 77 | 69 6c 6c 20 62 65 20 69 | tType w|ill be i|
|00002990| 67 6e 6f 72 65 64 2e 7d | 0d 0d 09 54 72 61 70 41 |gnored.}|...TrapA|
|000029a0| 76 61 69 6c 61 62 6c 65 | 20 3a 3d 20 4e 47 65 74 |vailable| := NGet|
|000029b0| 54 72 61 70 41 64 64 72 | 65 73 73 28 74 4e 75 6d |TrapAddr|ess(tNum|
|000029c0| 62 65 72 2c 20 74 54 79 | 70 65 29 20 3c 3e 20 47 |ber, tTy|pe) <> G|
|000029d0| 65 74 54 72 61 70 41 64 | 64 72 65 73 73 28 5f 55 |etTrapAd|dress(_U|
|000029e0| 6e 69 6d 70 6c 65 6d 65 | 6e 74 65 64 29 3b 0d 45 |nimpleme|nted);.E|
|000029f0| 4e 44 3b 20 7b 54 72 61 | 70 41 76 61 69 6c 61 62 |ND; {Tra|pAvailab|
|00002a00| 6c 65 7d 0d 0d 0d 7b 24 | 53 20 4d 61 69 6e 7d 0d |le}...{$|S Main}.|
|00002a10| 46 55 4e 43 54 49 4f 4e | 20 49 73 44 41 57 69 6e |FUNCTION| IsDAWin|
|00002a20| 64 6f 77 28 77 69 6e 64 | 6f 77 3a 20 57 69 6e 64 |dow(wind|ow: Wind|
|00002a30| 6f 77 50 74 72 29 3a 20 | 42 4f 4f 4c 45 41 4e 3b |owPtr): |BOOLEAN;|
|00002a40| 0d 0d 7b 43 68 65 63 6b | 20 69 66 20 61 20 77 69 |..{Check| if a wi|
|00002a50| 6e 64 6f 77 20 62 65 6c | 6f 6e 67 73 20 74 6f 20 |ndow bel|ongs to |
|00002a60| 61 20 64 65 73 6b 20 61 | 63 63 65 73 73 6f 72 79 |a desk a|ccessory|
|00002a70| 2e 7d 0d 0d 42 45 47 49 | 4e 0d 09 49 46 20 77 69 |.}..BEGI|N..IF wi|
|00002a80| 6e 64 6f 77 20 3d 20 4e | 49 4c 20 54 48 45 4e 0d |ndow = N|IL THEN.|
|00002a90| 09 09 49 73 44 41 57 69 | 6e 64 6f 77 20 3a 3d 20 |..IsDAWi|ndow := |
|00002aa0| 46 41 4c 53 45 0d 09 45 | 4c 53 45 09 7b 44 41 20 |FALSE..E|LSE.{DA |
|00002ab0| 77 69 6e 64 6f 77 73 20 | 68 61 76 65 20 6e 65 67 |windows |have neg|
|00002ac0| 61 74 69 76 65 20 77 69 | 6e 64 6f 77 4b 69 6e 64 |ative wi|ndowKind|
|00002ad0| 73 7d 0d 09 09 49 73 44 | 41 57 69 6e 64 6f 77 20 |s}...IsD|AWindow |
|00002ae0| 3a 3d 20 57 69 6e 64 6f | 77 50 65 65 6b 28 77 69 |:= Windo|wPeek(wi|
|00002af0| 6e 64 6f 77 29 5e 2e 77 | 69 6e 64 6f 77 4b 69 6e |ndow)^.w|indowKin|
|00002b00| 64 20 3c 20 30 3b 0d 45 | 4e 44 3b 20 7b 49 73 44 |d < 0;.E|ND; {IsD|
|00002b10| 41 57 69 6e 64 6f 77 7d | 0d 0d 0d 7b 24 53 20 4d |AWindow}|...{$S M|
|00002b20| 61 69 6e 7d 0d 46 55 4e | 43 54 49 4f 4e 20 49 73 |ain}.FUN|CTION Is|
|00002b30| 41 70 70 57 69 6e 64 6f | 77 28 77 69 6e 64 6f 77 |AppWindo|w(window|
|00002b40| 3a 20 57 69 6e 64 6f 77 | 50 74 72 29 3a 20 42 4f |: Window|Ptr): BO|
|00002b50| 4f 4c 45 41 4e 3b 0d 0d | 7b 43 68 65 63 6b 20 69 |OLEAN;..|{Check i|
|00002b60| 66 20 61 20 77 69 6e 64 | 6f 77 20 62 65 6c 6f 6e |f a wind|ow belon|
|00002b70| 67 73 20 74 6f 20 74 68 | 65 20 61 70 70 6c 69 63 |gs to th|e applic|
|00002b80| 61 74 69 6f 6e 2e 7d 0d | 0d 42 45 47 49 4e 0d 09 |ation.}.|.BEGIN..|
|00002b90| 49 46 20 77 69 6e 64 6f | 77 20 3d 20 4e 49 4c 20 |IF windo|w = NIL |
|00002ba0| 54 48 45 4e 0d 09 09 49 | 73 41 70 70 57 69 6e 64 |THEN...I|sAppWind|
|00002bb0| 6f 77 20 3a 3d 20 46 41 | 4c 53 45 0d 09 45 4c 53 |ow := FA|LSE..ELS|
|00002bc0| 45 09 7b 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 77 |E.{appli|cation w|
|00002bd0| 69 6e 64 6f 77 73 20 68 | 61 76 65 20 6e 6f 6e 2d |indows h|ave non-|
|00002be0| 6e 65 67 61 74 69 76 65 | 20 77 69 6e 64 6f 77 4b |negative| windowK|
|00002bf0| 69 6e 64 73 7d 0d 09 09 | 49 73 41 70 70 57 69 6e |inds}...|IsAppWin|
|00002c00| 64 6f 77 20 3a 3d 20 57 | 69 6e 64 6f 77 50 65 65 |dow := W|indowPee|
|00002c10| 6b 28 77 69 6e 64 6f 77 | 29 5e 2e 77 69 6e 64 6f |k(window|)^.windo|
|00002c20| 77 4b 69 6e 64 20 3e 3d | 20 30 3b 0d 45 4e 44 3b |wKind >=| 0;.END;|
|00002c30| 20 7b 49 73 41 70 70 57 | 69 6e 64 6f 77 7d 0d 0d | {IsAppW|indow}..|
|00002c40| 0d 7b 24 53 20 4d 61 69 | 6e 7d 0d 50 52 4f 43 45 |.{$S Mai|n}.PROCE|
|00002c50| 44 55 52 45 20 41 6c 65 | 72 74 55 73 65 72 28 65 |DURE Ale|rtUser(e|
|00002c60| 72 72 6f 72 3a 20 49 4e | 54 45 47 45 52 29 3b 0d |rror: IN|TEGER);.|
|00002c70| 0d 7b 44 69 73 70 6c 61 | 79 20 61 6e 20 61 6c 65 |.{Displa|y an ale|
|00002c80| 72 74 20 74 68 61 74 20 | 74 65 6c 6c 73 20 74 68 |rt that |tells th|
|00002c90| 65 20 75 73 65 72 20 61 | 6e 20 65 72 72 6f 72 20 |e user a|n error |
|00002ca0| 6f 63 63 75 72 72 65 64 | 2c 20 74 68 65 6e 20 65 |occurred|, then e|
|00002cb0| 78 69 74 20 74 68 65 20 | 70 72 6f 67 72 61 6d 2e |xit the |program.|
|00002cc0| 0d 20 54 68 69 73 20 72 | 6f 75 74 69 6e 65 20 69 |. This r|outine i|
|00002cd0| 73 20 75 73 65 64 20 61 | 73 20 61 6e 20 75 6c 74 |s used a|s an ult|
|00002ce0| 69 6d 61 74 65 20 62 61 | 69 6c 2d 6f 75 74 20 66 |imate ba|il-out f|
|00002cf0| 6f 72 20 73 65 72 69 6f | 75 73 20 65 72 72 6f 72 |or serio|us error|
|00002d00| 73 20 74 68 61 74 20 70 | 72 6f 68 69 62 69 74 0d |s that p|rohibit.|
|00002d10| 20 74 68 65 20 63 6f 6e | 74 69 6e 75 61 74 69 6f | the con|tinuatio|
|00002d20| 6e 20 6f 66 20 74 68 65 | 20 61 70 70 6c 69 63 61 |n of the| applica|
|00002d30| 74 69 6f 6e 2e 20 45 72 | 72 6f 72 73 20 74 68 61 |tion. Er|rors tha|
|00002d40| 74 20 64 6f 20 6e 6f 74 | 20 72 65 71 75 69 72 65 |t do not| require|
|00002d50| 20 74 68 65 20 74 65 72 | 6d 69 6e 61 74 69 6f 6e | the ter|mination|
|00002d60| 0d 20 6f 66 20 74 68 65 | 20 61 70 70 6c 69 63 61 |. of the| applica|
|00002d70| 74 69 6f 6e 20 73 68 6f | 75 6c 64 20 62 65 20 68 |tion sho|uld be h|
|00002d80| 61 6e 64 6c 65 64 20 69 | 6e 20 61 20 64 69 66 66 |andled i|n a diff|
|00002d90| 65 72 65 6e 74 20 6d 61 | 6e 6e 65 72 2e 20 45 72 |erent ma|nner. Er|
|00002da0| 72 6f 72 20 63 68 65 63 | 6b 69 6e 67 20 61 6e 64 |ror chec|king and|
|00002db0| 0d 20 72 65 70 6f 72 74 | 69 6e 67 20 68 61 73 20 |. report|ing has |
|00002dc0| 61 20 70 6c 61 63 65 20 | 65 76 65 6e 20 69 6e 20 |a place |even in |
|00002dd0| 74 68 65 20 73 69 6d 70 | 6c 65 73 74 20 61 70 70 |the simp|lest app|
|00002de0| 6c 69 63 61 74 69 6f 6e | 2e 20 54 68 65 20 65 72 |lication|. The er|
|00002df0| 72 6f 72 20 6e 75 6d 62 | 65 72 20 69 73 20 75 73 |ror numb|er is us|
|00002e00| 65 64 0d 20 74 6f 20 69 | 6e 64 65 78 20 61 6e 20 |ed. to i|ndex an |
|00002e10| 27 53 54 52 23 27 20 72 | 65 73 6f 75 72 63 65 20 |'STR#' r|esource |
|00002e20| 73 6f 20 74 68 61 74 20 | 61 20 72 65 6c 65 76 61 |so that |a releva|
|00002e30| 6e 74 20 6d 65 73 73 61 | 67 65 20 63 61 6e 20 62 |nt messa|ge can b|
|00002e40| 65 20 64 69 73 70 6c 61 | 79 65 64 2e 7d 0d 20 0d |e displa|yed.}. .|
|00002e50| 56 41 52 0d 09 69 74 65 | 6d 48 69 74 09 3a 20 49 |VAR..ite|mHit.: I|
|00002e60| 4e 54 45 47 45 52 3b 0d | 09 6d 65 73 73 61 67 65 |NTEGER;.|.message|
|00002e70| 09 3a 20 53 74 72 32 35 | 35 3b 0d 42 45 47 49 4e |.: Str25|5;.BEGIN|
|00002e80| 0d 09 53 65 74 43 75 72 | 73 6f 72 28 61 72 72 6f |..SetCur|sor(arro|
|00002e90| 77 29 3b 0d 09 47 65 74 | 49 6e 64 53 74 72 69 6e |w);..Get|IndStrin|
|00002ea0| 67 28 6d 65 73 73 61 67 | 65 2c 20 6b 45 72 72 53 |g(messag|e, kErrS|
|00002eb0| 74 72 69 6e 67 73 2c 20 | 65 72 72 6f 72 29 3b 0d |trings, |error);.|
|00002ec0| 09 50 61 72 61 6d 54 65 | 78 74 28 6d 65 73 73 61 |.ParamTe|xt(messa|
|00002ed0| 67 65 2c 20 27 27 2c 20 | 27 27 2c 20 27 27 29 3b |ge, '', |'', '');|
|00002ee0| 0d 09 69 74 65 6d 48 69 | 74 20 3a 3d 20 41 6c 65 |..itemHi|t := Ale|
|00002ef0| 72 74 28 72 55 73 65 72 | 41 6c 65 72 74 2c 20 4e |rt(rUser|Alert, N|
|00002f00| 49 4c 29 3b 0d 45 4e 44 | 3b 20 7b 41 6c 65 72 74 |IL);.END|; {Alert|
|00002f10| 55 73 65 72 7d 0d 0d 0d | 7b 24 53 20 4d 61 69 6e |User}...|{$S Main|
|00002f20| 7d 0d 50 52 4f 43 45 44 | 55 52 45 20 47 65 74 54 |}.PROCED|URE GetT|
|00002f30| 45 52 65 63 74 28 77 69 | 6e 64 6f 77 3a 20 57 69 |ERect(wi|ndow: Wi|
|00002f40| 6e 64 6f 77 50 74 72 3b | 20 56 41 52 20 74 65 52 |ndowPtr;| VAR teR|
|00002f50| 65 63 74 3a 20 52 65 63 | 74 29 3b 0d 0d 7b 72 65 |ect: Rec|t);..{re|
|00002f60| 74 75 72 6e 20 61 20 72 | 65 63 74 61 6e 67 6c 65 |turn a r|ectangle|
|00002f70| 20 74 68 61 74 20 69 73 | 20 69 6e 73 65 74 20 66 | that is| inset f|
|00002f80| 72 6f 6d 20 74 68 65 20 | 70 6f 72 74 52 65 63 74 |rom the |portRect|
|00002f90| 20 62 79 20 74 68 65 20 | 73 69 7a 65 20 6f 66 0d | by the |size of.|
|00002fa0| 74 68 65 20 73 63 72 6f | 6c 6c 62 61 72 73 20 61 |the scro|llbars a|
|00002fb0| 6e 64 20 61 20 6c 69 74 | 74 6c 65 20 65 78 74 72 |nd a lit|tle extr|
|00002fc0| 61 20 6d 61 72 67 69 6e | 2e 7d 0d 0d 42 45 47 49 |a margin|.}..BEGI|
|00002fd0| 4e 0d 09 74 65 52 65 63 | 74 20 3a 3d 20 77 69 6e |N..teRec|t := win|
|00002fe0| 64 6f 77 5e 2e 70 6f 72 | 74 52 65 63 74 3b 0d 09 |dow^.por|tRect;..|
|00002ff0| 49 6e 73 65 74 52 65 63 | 74 28 74 65 52 65 63 74 |InsetRec|t(teRect|
|00003000| 2c 20 6b 54 65 78 74 4d | 61 72 67 69 6e 2c 20 6b |, kTextM|argin, k|
|00003010| 54 65 78 74 4d 61 72 67 | 69 6e 29 3b 09 09 09 7b |TextMarg|in);...{|
|00003020| 61 64 6a 75 73 74 20 66 | 6f 72 20 6d 61 72 67 69 |adjust f|or margi|
|00003030| 6e 7d 0d 09 74 65 52 65 | 63 74 2e 62 6f 74 74 6f |n}..teRe|ct.botto|
|00003040| 6d 20 3a 3d 20 74 65 52 | 65 63 74 2e 62 6f 74 74 |m := teR|ect.bott|
|00003050| 6f 6d 20 2d 20 6b 53 63 | 72 6f 6c 6c 62 61 72 41 |om - kSc|rollbarA|
|00003060| 64 6a 75 73 74 3b 09 7b | 61 6e 64 20 66 6f 72 20 |djust;.{|and for |
|00003070| 74 68 65 20 73 63 72 6f | 6c 6c 62 61 72 73 7d 0d |the scro|llbars}.|
|00003080| 09 74 65 52 65 63 74 2e | 72 69 67 68 74 20 3a 3d |.teRect.|right :=|
|00003090| 20 74 65 52 65 63 74 2e | 72 69 67 68 74 20 2d 20 | teRect.|right - |
|000030a0| 6b 53 63 72 6f 6c 6c 62 | 61 72 41 64 6a 75 73 74 |kScrollb|arAdjust|
|000030b0| 3b 0d 45 4e 44 3b 20 7b | 47 65 74 54 45 52 65 63 |;.END; {|GetTERec|
|000030c0| 74 7d 0d 0d 0d 7b 24 53 | 20 4d 61 69 6e 7d 0d 46 |t}...{$S| Main}.F|
|000030d0| 55 4e 43 54 49 4f 4e 20 | 44 6f 43 6c 6f 73 65 57 |UNCTION |DoCloseW|
|000030e0| 69 6e 64 6f 77 28 77 69 | 6e 64 6f 77 3a 20 57 69 |indow(wi|ndow: Wi|
|000030f0| 6e 64 6f 77 50 74 72 29 | 20 3a 20 42 4f 4f 4c 45 |ndowPtr)| : BOOLE|
|00003100| 41 4e 3b 0d 0d 7b 43 6c | 6f 73 65 20 61 20 77 69 |AN;..{Cl|ose a wi|
|00003110| 6e 64 6f 77 2e 20 54 68 | 69 73 20 68 61 6e 64 6c |ndow. Th|is handl|
|00003120| 65 73 20 64 65 73 6b 20 | 61 63 63 65 73 73 6f 72 |es desk |accessor|
|00003130| 79 20 61 6e 64 20 61 70 | 70 6c 69 63 61 74 69 6f |y and ap|plicatio|
|00003140| 6e 20 77 69 6e 64 6f 77 | 73 2e 7d 0d 0d 7b 20 31 |n window|s.}..{ 1|
|00003150| 2e 30 31 20 2d 20 41 74 | 20 74 68 69 73 20 70 6f |.01 - At| this po|
|00003160| 69 6e 74 2c 20 69 66 20 | 74 68 65 72 65 20 77 61 |int, if |there wa|
|00003170| 73 20 61 20 64 6f 63 75 | 6d 65 6e 74 20 61 73 73 |s a docu|ment ass|
|00003180| 6f 63 69 61 74 65 64 20 | 77 69 74 68 20 61 0d 20 |ociated |with a. |
|00003190| 77 69 6e 64 6f 77 2c 20 | 79 6f 75 20 63 6f 75 6c |window, |you coul|
|000031a0| 64 20 64 6f 20 61 6e 79 | 20 64 6f 63 75 6d 65 6e |d do any| documen|
|000031b0| 74 20 73 61 76 69 6e 67 | 20 70 72 6f 63 65 73 73 |t saving| process|
|000031c0| 69 6e 67 20 69 66 20 69 | 74 20 69 73 20 27 64 69 |ing if i|t is 'di|
|000031d0| 72 74 79 27 2e 0d 20 44 | 6f 43 6c 6f 73 65 57 69 |rty'.. D|oCloseWi|
|000031e0| 6e 64 6f 77 20 77 6f 75 | 6c 64 20 72 65 74 75 72 |ndow wou|ld retur|
|000031f0| 6e 20 54 52 55 45 20 69 | 66 20 74 68 65 20 77 69 |n TRUE i|f the wi|
|00003200| 6e 64 6f 77 20 61 63 74 | 75 61 6c 6c 79 20 63 6c |ndow act|ually cl|
|00003210| 6f 73 65 64 2c 20 69 2e | 65 2e 2c 0d 20 74 68 65 |osed, i.|e.,. the|
|00003220| 20 75 73 65 72 20 64 69 | 64 6e d5 74 20 63 61 6e | user di|dn.t can|
|00003230| 63 65 6c 20 66 72 6f 6d | 20 61 20 73 61 76 65 20 |cel from| a save |
|00003240| 64 69 61 6c 6f 67 2e 20 | 54 68 69 73 20 72 65 73 |dialog. |This res|
|00003250| 75 6c 74 20 69 73 20 68 | 61 6e 64 79 20 77 68 65 |ult is h|andy whe|
|00003260| 6e 0d 20 74 68 65 20 75 | 73 65 72 20 71 75 69 74 |n. the u|ser quit|
|00003270| 73 20 61 6e 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |s an app|lication|
|00003280| 2c 20 62 75 74 20 74 68 | 65 6e 20 63 61 6e 63 65 |, but th|en cance|
|00003290| 6c 73 20 74 68 65 20 73 | 61 76 65 20 6f 66 20 61 |ls the s|ave of a|
|000032a0| 20 64 6f 63 75 6d 65 6e | 74 0d 20 61 73 73 6f 63 | documen|t. assoc|
|000032b0| 69 61 74 65 64 20 77 69 | 74 68 20 61 20 77 69 6e |iated wi|th a win|
|000032c0| 64 6f 77 2e 7d 0d 0d 42 | 45 47 49 4e 0d 09 44 6f |dow.}..B|EGIN..Do|
|000032d0| 43 6c 6f 73 65 57 69 6e | 64 6f 77 20 3a 3d 20 54 |CloseWin|dow := T|
|000032e0| 52 55 45 3b 0d 09 49 46 | 20 49 73 44 41 57 69 6e |RUE;..IF| IsDAWin|
|000032f0| 64 6f 77 28 77 69 6e 64 | 6f 77 29 20 54 48 45 4e |dow(wind|ow) THEN|
|00003300| 0d 09 09 43 6c 6f 73 65 | 44 65 73 6b 41 63 63 28 |...Close|DeskAcc(|
|00003310| 57 69 6e 64 6f 77 50 65 | 65 6b 28 77 69 6e 64 6f |WindowPe|ek(windo|
|00003320| 77 29 5e 2e 77 69 6e 64 | 6f 77 4b 69 6e 64 29 0d |w)^.wind|owKind).|
|00003330| 09 45 4c 53 45 20 49 46 | 20 49 73 41 70 70 57 69 |.ELSE IF| IsAppWi|
|00003340| 6e 64 6f 77 28 77 69 6e | 64 6f 77 29 20 54 48 45 |ndow(win|dow) THE|
|00003350| 4e 20 42 45 47 49 4e 0d | 09 09 57 49 54 48 20 44 |N BEGIN.|..WITH D|
|00003360| 6f 63 75 6d 65 6e 74 50 | 65 65 6b 28 77 69 6e 64 |ocumentP|eek(wind|
|00003370| 6f 77 29 5e 20 44 4f 0d | 09 09 09 49 46 20 64 6f |ow)^ DO.|...IF do|
|00003380| 63 54 45 20 3c 3e 20 4e | 49 4c 20 54 48 45 4e 0d |cTE <> N|IL THEN.|
|00003390| 09 09 09 09 54 45 44 69 | 73 70 6f 73 65 28 64 6f |....TEDi|spose(do|
|000033a0| 63 54 45 29 3b 09 09 7b | 64 69 73 70 6f 73 65 20 |cTE);..{|dispose |
|000033b0| 74 68 65 20 54 45 48 61 | 6e 64 6c 65 7d 0d 09 09 |the TEHa|ndle}...|
|000033c0| 7b 31 2e 30 31 20 2d 20 | 57 65 20 75 73 65 64 20 |{1.01 - |We used |
|000033d0| 74 6f 20 63 61 6c 6c 20 | 44 69 73 70 6f 73 65 57 |to call |DisposeW|
|000033e0| 69 6e 64 6f 77 2c 20 62 | 75 74 20 74 68 61 74 20 |indow, b|ut that |
|000033f0| 77 61 73 20 74 65 63 68 | 6e 69 63 61 6c 6c 79 0d |was tech|nically.|
|00003400| 09 09 20 69 6e 63 6f 72 | 72 65 63 74 2c 20 65 76 |.. incor|rect, ev|
|00003410| 65 6e 20 74 68 6f 75 67 | 68 20 77 65 20 61 6c 6c |en thoug|h we all|
|00003420| 6f 63 61 74 65 64 20 73 | 74 6f 72 61 67 65 20 66 |ocated s|torage f|
|00003430| 6f 72 20 74 68 65 20 77 | 69 6e 64 6f 77 20 6f 6e |or the w|indow on|
|00003440| 0d 09 09 20 74 68 65 20 | 68 65 61 70 2e 20 57 65 |... the |heap. We|
|00003450| 20 73 68 6f 75 6c 64 20 | 69 6e 73 74 65 61 64 20 | should |instead |
|00003460| 63 61 6c 6c 20 43 6c 6f | 73 65 57 69 6e 64 6f 77 |call Clo|seWindow|
|00003470| 20 74 6f 20 68 61 76 65 | 20 74 68 65 20 73 74 72 | to have| the str|
|00003480| 75 63 74 75 72 65 73 0d | 09 09 20 74 61 6b 65 6e |uctures.|.. taken|
|00003490| 20 63 61 72 65 20 6f 66 | 20 61 6e 64 20 74 68 65 | care of| and the|
|000034a0| 6e 20 64 69 73 70 6f 73 | 65 20 6f 66 20 74 68 65 |n dispos|e of the|
|000034b0| 20 73 74 6f 72 61 67 65 | 20 6f 75 72 73 65 6c 76 | storage| ourselv|
|000034c0| 65 73 2e 7d 0d 09 09 43 | 6c 6f 73 65 57 69 6e 64 |es.}...C|loseWind|
|000034d0| 6f 77 28 77 69 6e 64 6f | 77 29 3b 0d 09 09 44 69 |ow(windo|w);...Di|
|000034e0| 73 70 6f 73 50 74 72 28 | 50 74 72 28 77 69 6e 64 |sposPtr(|Ptr(wind|
|000034f0| 6f 77 29 29 3b 0d 09 09 | 67 4e 75 6d 44 6f 63 75 |ow));...|gNumDocu|
|00003500| 6d 65 6e 74 73 20 3a 3d | 20 67 4e 75 6d 44 6f 63 |ments :=| gNumDoc|
|00003510| 75 6d 65 6e 74 73 20 2d | 20 31 3b 0d 09 45 4e 44 |uments -| 1;..END|
|00003520| 3b 0d 45 4e 44 3b 20 7b | 44 6f 43 6c 6f 73 65 57 |;.END; {|DoCloseW|
|00003530| 69 6e 64 6f 77 7d 0d 0d | 0d 7b 24 53 20 4d 61 69 |indow}..|.{$S Mai|
|00003540| 6e 7d 0d 50 52 4f 43 45 | 44 55 52 45 20 41 64 6a |n}.PROCE|DURE Adj|
|00003550| 75 73 74 56 69 65 77 52 | 65 63 74 28 64 6f 63 54 |ustViewR|ect(docT|
|00003560| 45 3a 20 54 45 48 61 6e | 64 6c 65 29 3b 0d 0d 7b |E: TEHan|dle);..{|
|00003570| 55 70 64 61 74 65 20 74 | 68 65 20 54 45 52 65 63 |Update t|he TERec|
|00003580| 27 73 20 76 69 65 77 20 | 72 65 63 74 20 73 6f 20 |'s view |rect so |
|00003590| 74 68 61 74 20 69 74 20 | 69 73 20 74 68 65 20 67 |that it |is the g|
|000035a0| 72 65 61 74 65 73 74 20 | 6d 75 6c 74 69 70 6c 65 |reatest |multiple|
|000035b0| 20 6f 66 0d 74 68 65 20 | 6c 69 6e 65 48 65 69 67 | of.the |lineHeig|
|000035c0| 68 74 20 61 6e 64 20 73 | 74 69 6c 6c 20 66 69 74 |ht and s|till fit|
|000035d0| 73 20 69 6e 20 74 68 65 | 20 6f 6c 64 20 76 69 65 |s in the| old vie|
|000035e0| 77 52 65 63 74 2e 7d 0d | 0d 42 45 47 49 4e 0d 09 |wRect.}.|.BEGIN..|
|000035f0| 57 49 54 48 20 64 6f 63 | 54 45 5e 5e 20 44 4f 20 |WITH doc|TE^^ DO |
|00003600| 42 45 47 49 4e 0d 09 09 | 76 69 65 77 52 65 63 74 |BEGIN...|viewRect|
|00003610| 2e 62 6f 74 74 6f 6d 20 | 3a 3d 20 28 28 28 76 69 |.bottom |:= (((vi|
|00003620| 65 77 52 65 63 74 2e 62 | 6f 74 74 6f 6d 20 2d 20 |ewRect.b|ottom - |
|00003630| 76 69 65 77 52 65 63 74 | 2e 74 6f 70 29 20 44 49 |viewRect|.top) DI|
|00003640| 56 20 6c 69 6e 65 48 65 | 69 67 68 74 29 20 2a 0d |V lineHe|ight) *.|
|00003650| 09 09 09 09 09 09 09 6c | 69 6e 65 48 65 69 67 68 |.......l|ineHeigh|
|00003660| 74 29 20 2b 20 76 69 65 | 77 52 65 63 74 2e 74 6f |t) + vie|wRect.to|
|00003670| 70 3b 0d 09 45 4e 44 3b | 0d 45 4e 44 3b 20 7b 41 |p;..END;|.END; {A|
|00003680| 64 6a 75 73 74 56 69 65 | 77 52 65 63 74 7d 0d 0d |djustVie|wRect}..|
|00003690| 0d 7b 24 53 20 4d 61 69 | 6e 7d 0d 50 52 4f 43 45 |.{$S Mai|n}.PROCE|
|000036a0| 44 55 52 45 20 41 64 6a | 75 73 74 54 45 28 77 69 |DURE Adj|ustTE(wi|
|000036b0| 6e 64 6f 77 3a 20 57 69 | 6e 64 6f 77 50 74 72 29 |ndow: Wi|ndowPtr)|
|000036c0| 3b 0d 0d 7b 53 63 72 6f | 6c 6c 20 74 68 65 20 54 |;..{Scro|ll the T|
|000036d0| 45 52 65 63 20 61 72 6f | 75 6e 64 20 74 6f 20 6d |ERec aro|und to m|
|000036e0| 61 74 63 68 20 75 70 20 | 74 6f 20 74 68 65 20 70 |atch up |to the p|
|000036f0| 6f 74 65 6e 74 69 61 6c | 6c 79 20 75 70 64 61 74 |otential|ly updat|
|00003700| 65 64 20 73 63 72 6f 6c | 6c 62 61 72 0d 76 61 6c |ed scrol|lbar.val|
|00003710| 75 65 73 2e 20 54 68 69 | 73 20 69 73 20 72 65 61 |ues. Thi|s is rea|
|00003720| 6c 6c 79 20 75 73 65 66 | 75 6c 20 77 68 65 6e 20 |lly usef|ul when |
|00003730| 74 68 65 20 77 69 6e 64 | 6f 77 20 72 65 73 69 7a |the wind|ow resiz|
|00003740| 65 73 20 73 75 63 68 20 | 74 68 61 74 20 74 68 65 |es such |that the|
|00003750| 0d 73 63 72 6f 6c 6c 62 | 61 72 73 20 62 65 63 6f |.scrollb|ars beco|
|00003760| 6d 65 20 69 6e 61 63 74 | 69 76 65 20 61 6e 64 20 |me inact|ive and |
|00003770| 74 68 65 20 54 45 52 65 | 63 20 68 61 64 20 62 65 |the TERe|c had be|
|00003780| 65 6e 20 70 72 65 76 69 | 6f 75 73 6c 79 20 73 63 |en previ|ously sc|
|00003790| 72 6f 6c 6c 65 64 2e 7d | 0d 0d 56 41 52 0d 09 76 |rolled.}|..VAR..v|
|000037a0| 61 6c 75 65 09 3a 20 49 | 4e 54 45 47 45 52 3b 0d |alue.: I|NTEGER;.|
|000037b0| 42 45 47 49 4e 0d 09 57 | 49 54 48 20 44 6f 63 75 |BEGIN..W|ITH Docu|
|000037c0| 6d 65 6e 74 50 65 65 6b | 28 77 69 6e 64 6f 77 29 |mentPeek|(window)|
|000037d0| 5e 20 44 4f 20 42 45 47 | 49 4e 0d 09 09 54 45 53 |^ DO BEG|IN...TES|
|000037e0| 63 72 6f 6c 6c 28 28 64 | 6f 63 54 45 5e 5e 2e 76 |croll((d|ocTE^^.v|
|000037f0| 69 65 77 52 65 63 74 2e | 6c 65 66 74 20 2d 20 64 |iewRect.|left - d|
|00003800| 6f 63 54 45 5e 5e 2e 64 | 65 73 74 52 65 63 74 2e |ocTE^^.d|estRect.|
|00003810| 6c 65 66 74 29 20 2d 20 | 47 65 74 43 74 6c 56 61 |left) - |GetCtlVa|
|00003820| 6c 75 65 28 64 6f 63 48 | 53 63 72 6f 6c 6c 29 2c |lue(docH|Scroll),|
|00003830| 0d 09 09 09 09 28 64 6f | 63 54 45 5e 5e 2e 76 69 |.....(do|cTE^^.vi|
|00003840| 65 77 52 65 63 74 2e 74 | 6f 70 20 2d 20 64 6f 63 |ewRect.t|op - doc|
|00003850| 54 45 5e 5e 2e 64 65 73 | 74 52 65 63 74 2e 74 6f |TE^^.des|tRect.to|
|00003860| 70 29 20 2d 0d 09 09 09 | 09 09 28 47 65 74 43 74 |p) -....|..(GetCt|
|00003870| 6c 56 61 6c 75 65 28 64 | 6f 63 56 53 63 72 6f 6c |lValue(d|ocVScrol|
|00003880| 6c 29 20 2a 20 64 6f 63 | 54 45 5e 5e 2e 6c 69 6e |l) * doc|TE^^.lin|
|00003890| 65 48 65 69 67 68 74 29 | 2c 0d 09 09 09 09 64 6f |eHeight)|,.....do|
|000038a0| 63 54 45 29 3b 0d 09 45 | 4e 44 3b 0d 45 4e 44 3b |cTE);..E|ND;.END;|
|000038b0| 20 7b 41 64 6a 75 73 74 | 54 45 7d 0d 0d 0d 7b 24 | {Adjust|TE}...{$|
|000038c0| 53 20 4d 61 69 6e 7d 0d | 50 52 4f 43 45 44 55 52 |S Main}.|PROCEDUR|
|000038d0| 45 20 41 64 6a 75 73 74 | 48 56 28 69 73 56 65 72 |E Adjust|HV(isVer|
|000038e0| 74 3a 20 42 4f 4f 4c 45 | 41 4e 3b 20 63 6f 6e 74 |t: BOOLE|AN; cont|
|000038f0| 72 6f 6c 3a 20 43 6f 6e | 74 72 6f 6c 48 61 6e 64 |rol: Con|trolHand|
|00003900| 6c 65 3b 20 64 6f 63 54 | 45 3a 20 54 45 48 61 6e |le; docT|E: TEHan|
|00003910| 64 6c 65 3b 20 63 61 6e | 52 65 64 72 61 77 3a 20 |dle; can|Redraw: |
|00003920| 42 4f 4f 4c 45 41 4e 29 | 3b 0d 0d 7b 43 61 6c 63 |BOOLEAN)|;..{Calc|
|00003930| 75 6c 61 74 65 20 74 68 | 65 20 6e 65 77 20 63 6f |ulate th|e new co|
|00003940| 6e 74 72 6f 6c 20 6d 61 | 78 69 6d 75 6d 20 76 61 |ntrol ma|ximum va|
|00003950| 6c 75 65 20 61 6e 64 20 | 63 75 72 72 65 6e 74 20 |lue and |current |
|00003960| 76 61 6c 75 65 2c 20 77 | 68 65 74 68 65 72 20 69 |value, w|hether i|
|00003970| 74 20 69 73 20 74 68 65 | 20 68 6f 72 69 7a 6f 6e |t is the| horizon|
|00003980| 74 61 6c 20 6f 72 0d 76 | 65 72 74 69 63 61 6c 20 |tal or.v|ertical |
|00003990| 73 63 72 6f 6c 6c 62 61 | 72 2e 20 54 68 65 20 76 |scrollba|r. The v|
|000039a0| 65 72 74 69 63 61 6c 20 | 6d 61 78 20 69 73 20 63 |ertical |max is c|
|000039b0| 61 6c 63 75 6c 61 74 65 | 64 20 62 79 20 63 6f 6d |alculate|d by com|
|000039c0| 70 61 72 69 6e 67 20 74 | 68 65 20 6e 75 6d 62 65 |paring t|he numbe|
|000039d0| 72 20 6f 66 20 6c 69 6e | 65 73 20 74 6f 20 74 68 |r of lin|es to th|
|000039e0| 65 0d 76 65 72 74 69 63 | 61 6c 20 73 69 7a 65 20 |e.vertic|al size |
|000039f0| 6f 66 20 74 68 65 20 76 | 69 65 77 52 65 63 74 2e |of the v|iewRect.|
|00003a00| 20 54 68 65 20 68 6f 72 | 69 7a 6f 6e 74 61 6c 20 | The hor|izontal |
|00003a10| 6d 61 78 20 69 73 20 63 | 61 6c 63 75 6c 61 74 65 |max is c|alculate|
|00003a20| 64 20 62 79 20 63 6f 6d | 70 61 72 69 6e 67 20 74 |d by com|paring t|
|00003a30| 68 65 20 6d 61 78 69 6d | 75 6d 20 64 6f 63 75 6d |he maxim|um docum|
|00003a40| 65 6e 74 0d 77 69 64 74 | 68 20 74 6f 20 74 68 65 |ent.widt|h to the|
|00003a50| 20 77 69 64 74 68 20 6f | 66 20 74 68 65 20 76 69 | width o|f the vi|
|00003a60| 65 77 52 65 63 74 2e 20 | 54 68 65 20 63 75 72 72 |ewRect. |The curr|
|00003a70| 65 6e 74 20 76 61 6c 75 | 65 73 20 61 72 65 20 73 |ent valu|es are s|
|00003a80| 65 74 20 62 79 20 63 6f | 6d 70 61 72 69 6e 67 20 |et by co|mparing |
|00003a90| 74 68 65 20 6f 66 66 73 | 65 74 20 62 65 74 77 65 |the offs|et betwe|
|00003aa0| 65 6e 0d 74 68 65 20 76 | 69 65 77 20 61 6e 64 20 |en.the v|iew and |
|00003ab0| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 72 65 63 74 |destinat|ion rect|
|00003ac0| 73 2e 20 49 66 20 6e 65 | 63 65 73 73 61 72 79 20 |s. If ne|cessary |
|00003ad0| 61 6e 64 20 77 65 20 63 | 61 6e 52 65 64 72 61 77 |and we c|anRedraw|
|00003ae0| 2c 20 68 61 76 65 20 74 | 68 65 20 63 6f 6e 74 72 |, have t|he contr|
|00003af0| 6f 6c 20 62 65 20 72 65 | 2d 64 72 61 77 6e 20 62 |ol be re|-drawn b|
|00003b00| 79 0d 63 61 6c 6c 69 6e | 67 20 53 68 6f 77 43 6f |y.callin|g ShowCo|
|00003b10| 6e 74 72 6f 6c 2e 7d 0d | 0d 56 41 52 0d 09 76 61 |ntrol.}.|.VAR..va|
|00003b20| 6c 75 65 2c 20 6c 69 6e | 65 73 2c 20 6d 61 78 09 |lue, lin|es, max.|
|00003b30| 3a 20 49 4e 54 45 47 45 | 52 3b 0d 09 6f 6c 64 56 |: INTEGE|R;..oldV|
|00003b40| 61 6c 75 65 2c 20 6f 6c | 64 4d 61 78 09 3a 20 49 |alue, ol|dMax.: I|
|00003b50| 4e 54 45 47 45 52 3b 0d | 42 45 47 49 4e 0d 09 6f |NTEGER;.|BEGIN..o|
|00003b60| 6c 64 56 61 6c 75 65 20 | 3a 3d 20 47 65 74 43 74 |ldValue |:= GetCt|
|00003b70| 6c 56 61 6c 75 65 28 63 | 6f 6e 74 72 6f 6c 29 3b |lValue(c|ontrol);|
|00003b80| 0d 09 6f 6c 64 4d 61 78 | 20 3a 3d 20 47 65 74 43 |..oldMax| := GetC|
|00003b90| 74 6c 4d 61 78 28 63 6f | 6e 74 72 6f 6c 29 3b 0d |tlMax(co|ntrol);.|
|00003ba0| 09 49 46 20 69 73 56 65 | 72 74 20 54 48 45 4e 20 |.IF isVe|rt THEN |
|00003bb0| 42 45 47 49 4e 0d 09 09 | 6c 69 6e 65 73 20 3a 3d |BEGIN...|lines :=|
|00003bc0| 20 64 6f 63 54 45 5e 5e | 2e 6e 4c 69 6e 65 73 3b | docTE^^|.nLines;|
|00003bd0| 0d 09 09 7b 73 69 6e 63 | 65 20 6e 4c 69 6e 65 73 |...{sinc|e nLines|
|00003be0| 20 69 73 6e d5 74 20 72 | 69 67 68 74 20 69 66 20 | isn.t r|ight if |
|00003bf0| 74 68 65 20 6c 61 73 74 | 20 63 68 61 72 61 63 74 |the last| charact|
|00003c00| 65 72 20 69 73 20 61 20 | 72 65 74 75 72 6e 2c 20 |er is a |return, |
|00003c10| 63 68 65 63 6b 20 66 6f | 72 20 74 68 61 74 20 63 |check fo|r that c|
|00003c20| 61 73 65 7d 0d 09 09 49 | 46 20 50 74 72 28 4f 52 |ase}...I|F Ptr(OR|
|00003c30| 44 28 64 6f 63 54 45 5e | 5e 2e 68 54 65 78 74 5e |D(docTE^|^.hText^|
|00003c40| 29 20 2b 20 64 6f 63 54 | 45 5e 5e 2e 74 65 4c 65 |) + docT|E^^.teLe|
|00003c50| 6e 67 74 68 20 2d 20 31 | 29 5e 20 3d 20 6b 43 52 |ngth - 1|)^ = kCR|
|00003c60| 43 68 61 72 20 54 48 45 | 4e 0d 09 09 09 6c 69 6e |Char THE|N....lin|
|00003c70| 65 73 20 3a 3d 20 6c 69 | 6e 65 73 20 2b 20 31 3b |es := li|nes + 1;|
|00003c80| 0d 09 09 6d 61 78 20 3a | 3d 20 6c 69 6e 65 73 20 |...max :|= lines |
|00003c90| 2d 20 28 28 64 6f 63 54 | 45 5e 5e 2e 76 69 65 77 |- ((docT|E^^.view|
|00003ca0| 52 65 63 74 2e 62 6f 74 | 74 6f 6d 20 2d 20 64 6f |Rect.bot|tom - do|
|00003cb0| 63 54 45 5e 5e 2e 76 69 | 65 77 52 65 63 74 2e 74 |cTE^^.vi|ewRect.t|
|00003cc0| 6f 70 29 20 44 49 56 20 | 64 6f 63 54 45 5e 5e 2e |op) DIV |docTE^^.|
|00003cd0| 6c 69 6e 65 48 65 69 67 | 68 74 29 3b 0d 09 45 4e |lineHeig|ht);..EN|
|00003ce0| 44 20 45 4c 53 45 0d 09 | 09 6d 61 78 20 3a 3d 20 |D ELSE..|.max := |
|00003cf0| 6b 4d 61 78 44 6f 63 57 | 69 64 74 68 20 2d 20 28 |kMaxDocW|idth - (|
|00003d00| 64 6f 63 54 45 5e 5e 2e | 76 69 65 77 52 65 63 74 |docTE^^.|viewRect|
|00003d10| 2e 72 69 67 68 74 20 2d | 20 64 6f 63 54 45 5e 5e |.right -| docTE^^|
|00003d20| 2e 76 69 65 77 52 65 63 | 74 2e 6c 65 66 74 29 3b |.viewRec|t.left);|
|00003d30| 0d 09 49 46 20 6d 61 78 | 20 3c 20 30 20 54 48 45 |..IF max| < 0 THE|
|00003d40| 4e 20 6d 61 78 20 3a 3d | 20 30 3b 09 09 09 7b 63 |N max :=| 0;...{c|
|00003d50| 68 65 63 6b 20 66 6f 72 | 20 6e 65 67 61 74 69 76 |heck for| negativ|
|00003d60| 65 20 76 61 6c 75 65 73 | 7d 0d 09 53 65 74 43 74 |e values|}..SetCt|
|00003d70| 6c 4d 61 78 28 63 6f 6e | 74 72 6f 6c 2c 20 6d 61 |lMax(con|trol, ma|
|00003d80| 78 29 3b 0d 09 49 46 20 | 69 73 56 65 72 74 20 54 |x);..IF |isVert T|
|00003d90| 48 45 4e 0d 09 09 76 61 | 6c 75 65 20 3a 3d 20 28 |HEN...va|lue := (|
|00003da0| 64 6f 63 54 45 5e 5e 2e | 76 69 65 77 52 65 63 74 |docTE^^.|viewRect|
|00003db0| 2e 74 6f 70 20 2d 20 64 | 6f 63 54 45 5e 5e 2e 64 |.top - d|ocTE^^.d|
|00003dc0| 65 73 74 52 65 63 74 2e | 74 6f 70 29 20 44 49 56 |estRect.|top) DIV|
|00003dd0| 20 64 6f 63 54 45 5e 5e | 2e 6c 69 6e 65 48 65 69 | docTE^^|.lineHei|
|00003de0| 67 68 74 0d 09 45 4c 53 | 45 0d 09 09 76 61 6c 75 |ght..ELS|E...valu|
|00003df0| 65 20 3a 3d 20 64 6f 63 | 54 45 5e 5e 2e 76 69 65 |e := doc|TE^^.vie|
|00003e00| 77 52 65 63 74 2e 6c 65 | 66 74 20 2d 20 64 6f 63 |wRect.le|ft - doc|
|00003e10| 54 45 5e 5e 2e 64 65 73 | 74 52 65 63 74 2e 6c 65 |TE^^.des|tRect.le|
|00003e20| 66 74 3b 0d 09 49 46 20 | 76 61 6c 75 65 20 3c 20 |ft;..IF |value < |
|00003e30| 30 20 54 48 45 4e 0d 09 | 09 76 61 6c 75 65 20 3a |0 THEN..|.value :|
|00003e40| 3d 20 30 0d 09 45 4c 53 | 45 20 49 46 20 76 61 6c |= 0..ELS|E IF val|
|00003e50| 75 65 20 3e 20 6d 61 78 | 20 54 48 45 4e 0d 09 09 |ue > max| THEN...|
|00003e60| 76 61 6c 75 65 20 3a 3d | 20 6d 61 78 3b 09 09 09 |value :=| max;...|
|00003e70| 09 09 7b 70 69 6e 20 74 | 68 65 20 76 61 6c 75 65 |..{pin t|he value|
|00003e80| 20 74 6f 20 77 69 74 68 | 69 6e 20 72 61 6e 67 65 | to with|in range|
|00003e90| 7d 0d 09 53 65 74 43 74 | 6c 56 61 6c 75 65 28 63 |}..SetCt|lValue(c|
|00003ea0| 6f 6e 74 72 6f 6c 2c 20 | 76 61 6c 75 65 29 3b 0d |ontrol, |value);.|
|00003eb0| 09 49 46 20 63 61 6e 52 | 65 64 72 61 77 20 26 20 |.IF canR|edraw & |
|00003ec0| 28 20 28 6d 61 78 20 3c | 3e 20 6f 6c 64 4d 61 78 |( (max <|> oldMax|
|00003ed0| 29 20 7c 20 28 76 61 6c | 75 65 20 3c 3e 20 6f 6c |) | (val|ue <> ol|
|00003ee0| 64 56 61 6c 75 65 29 20 | 29 20 54 48 45 4e 0d 09 |dValue) |) THEN..|
|00003ef0| 09 53 68 6f 77 43 6f 6e | 74 72 6f 6c 28 63 6f 6e |.ShowCon|trol(con|
|00003f00| 74 72 6f 6c 29 3b 09 09 | 09 7b 63 68 65 63 6b 20 |trol);..|.{check |
|00003f10| 74 6f 20 73 65 65 20 69 | 66 20 74 68 65 20 63 6f |to see i|f the co|
|00003f20| 6e 74 72 6f 6c 20 63 61 | 6e 20 62 65 20 72 65 2d |ntrol ca|n be re-|
|00003f30| 64 72 61 77 6e 7d 0d 45 | 4e 44 3b 20 7b 41 64 6a |drawn}.E|ND; {Adj|
|00003f40| 75 73 74 48 56 7d 0d 0d | 0d 7b 24 53 20 4d 61 69 |ustHV}..|.{$S Mai|
|00003f50| 6e 7d 0d 50 52 4f 43 45 | 44 55 52 45 20 41 64 6a |n}.PROCE|DURE Adj|
|00003f60| 75 73 74 53 63 72 6f 6c | 6c 56 61 6c 75 65 73 28 |ustScrol|lValues(|
|00003f70| 77 69 6e 64 6f 77 3a 20 | 57 69 6e 64 6f 77 50 74 |window: |WindowPt|
|00003f80| 72 3b 20 63 61 6e 52 65 | 64 72 61 77 3a 20 42 4f |r; canRe|draw: BO|
|00003f90| 4f 4c 45 41 4e 29 3b 0d | 0d 7b 53 69 6d 70 6c 79 |OLEAN);.|.{Simply|
|00003fa0| 20 63 61 6c 6c 20 74 68 | 65 20 63 6f 6d 6d 6f 6e | call th|e common|
|00003fb0| 20 61 64 6a 75 73 74 20 | 72 6f 75 74 69 6e 65 20 | adjust |routine |
|00003fc0| 66 6f 72 20 74 68 65 20 | 76 65 72 74 69 63 61 6c |for the |vertical|
|00003fd0| 20 61 6e 64 20 68 6f 72 | 69 7a 6f 6e 74 61 6c 20 | and hor|izontal |
|00003fe0| 73 63 72 6f 6c 6c 62 61 | 72 73 2e 7d 0d 0d 42 45 |scrollba|rs.}..BE|
|00003ff0| 47 49 4e 0d 09 57 49 54 | 48 20 44 6f 63 75 6d 65 |GIN..WIT|H Docume|
|00004000| 6e 74 50 65 65 6b 28 77 | 69 6e 64 6f 77 29 5e 20 |ntPeek(w|indow)^ |
|00004010| 44 4f 20 42 45 47 49 4e | 0d 09 09 41 64 6a 75 73 |DO BEGIN|...Adjus|
|00004020| 74 48 56 28 54 52 55 45 | 2c 20 64 6f 63 56 53 63 |tHV(TRUE|, docVSc|
|00004030| 72 6f 6c 6c 2c 20 64 6f | 63 54 45 2c 20 63 61 6e |roll, do|cTE, can|
|00004040| 52 65 64 72 61 77 29 3b | 0d 09 09 41 64 6a 75 73 |Redraw);|...Adjus|
|00004050| 74 48 56 28 46 41 4c 53 | 45 2c 20 64 6f 63 48 53 |tHV(FALS|E, docHS|
|00004060| 63 72 6f 6c 6c 2c 20 64 | 6f 63 54 45 2c 20 63 61 |croll, d|ocTE, ca|
|00004070| 6e 52 65 64 72 61 77 29 | 3b 0d 09 45 4e 44 3b 0d |nRedraw)|;..END;.|
|00004080| 45 4e 44 3b 20 7b 41 64 | 6a 75 73 74 53 63 72 6f |END; {Ad|justScro|
|00004090| 6c 6c 56 61 6c 75 65 73 | 7d 0d 0d 0d 7b 24 53 20 |llValues|}...{$S |
|000040a0| 4d 61 69 6e 7d 0d 50 52 | 4f 43 45 44 55 52 45 20 |Main}.PR|OCEDURE |
|000040b0| 41 64 6a 75 73 74 53 63 | 72 6f 6c 6c 53 69 7a 65 |AdjustSc|rollSize|
|000040c0| 73 28 77 69 6e 64 6f 77 | 3a 20 57 69 6e 64 6f 77 |s(window|: Window|
|000040d0| 50 74 72 29 3b 0d 0d 7b | 52 65 2d 63 61 6c 63 75 |Ptr);..{|Re-calcu|
|000040e0| 6c 61 74 65 20 74 68 65 | 20 70 6f 73 69 74 69 6f |late the| positio|
|000040f0| 6e 20 61 6e 64 20 73 69 | 7a 65 20 6f 66 20 74 68 |n and si|ze of th|
|00004100| 65 20 76 69 65 77 52 65 | 63 74 20 61 6e 64 20 74 |e viewRe|ct and t|
|00004110| 68 65 20 73 63 72 6f 6c | 6c 62 61 72 73 2e 0d 20 |he scrol|lbars.. |
|00004120| 6b 53 63 72 6f 6c 6c 54 | 77 65 65 6b 20 63 6f 6d |kScrollT|week com|
|00004130| 70 65 6e 73 61 74 65 73 | 20 66 6f 72 20 6f 66 66 |pensates| for off|
|00004140| 2d 62 79 2d 6f 6e 65 20 | 72 65 71 75 69 72 65 6d |-by-one |requirem|
|00004150| 65 6e 74 73 20 6f 66 20 | 74 68 65 20 73 63 72 6f |ents of |the scro|
|00004160| 6c 6c 62 61 72 73 0d 20 | 74 6f 20 68 61 76 65 20 |llbars. |to have |
|00004170| 62 6f 72 64 65 72 73 20 | 63 6f 69 6e 63 69 64 65 |borders |coincide|
|00004180| 20 77 69 74 68 20 74 68 | 65 20 67 72 6f 77 62 6f | with th|e growbo|
|00004190| 78 2e 7d 0d 0d 56 41 52 | 0d 09 74 65 52 65 63 74 |x.}..VAR|..teRect|
|000041a0| 09 3a 20 52 65 63 74 3b | 0d 42 45 47 49 4e 0d 09 |.: Rect;|.BEGIN..|
|000041b0| 47 65 74 54 45 52 65 63 | 74 28 77 69 6e 64 6f 77 |GetTERec|t(window|
|000041c0| 2c 20 74 65 52 65 63 74 | 29 3b 09 09 09 09 09 09 |, teRect|);......|
|000041d0| 09 09 09 09 7b 73 74 61 | 72 74 20 77 69 74 68 20 |....{sta|rt with |
|000041e0| 74 65 52 65 63 74 7d 0d | 09 57 49 54 48 20 44 6f |teRect}.|.WITH Do|
|000041f0| 63 75 6d 65 6e 74 50 65 | 65 6b 28 77 69 6e 64 6f |cumentPe|ek(windo|
|00004200| 77 29 5e 2c 20 77 69 6e | 64 6f 77 5e 2e 70 6f 72 |w)^, win|dow^.por|
|00004210| 74 52 65 63 74 20 44 4f | 20 42 45 47 49 4e 0d 09 |tRect DO| BEGIN..|
|00004220| 09 64 6f 63 54 45 5e 5e | 2e 76 69 65 77 52 65 63 |.docTE^^|.viewRec|
|00004230| 74 20 3a 3d 20 74 65 52 | 65 63 74 3b 0d 09 09 41 |t := teR|ect;...A|
|00004240| 64 6a 75 73 74 56 69 65 | 77 52 65 63 74 28 64 6f |djustVie|wRect(do|
|00004250| 63 54 45 29 3b 09 09 09 | 09 09 09 09 09 09 09 7b |cTE);...|.......{|
|00004260| 73 6e 61 70 20 74 6f 20 | 6e 65 61 72 65 73 74 20 |snap to |nearest |
|00004270| 6c 69 6e 65 7d 0d 09 09 | 4d 6f 76 65 43 6f 6e 74 |line}...|MoveCont|
|00004280| 72 6f 6c 28 64 6f 63 56 | 53 63 72 6f 6c 6c 2c 20 |rol(docV|Scroll, |
|00004290| 72 69 67 68 74 20 2d 20 | 6b 53 63 72 6f 6c 6c 62 |right - |kScrollb|
|000042a0| 61 72 41 64 6a 75 73 74 | 2c 20 2d 31 29 3b 0d 09 |arAdjust|, -1);..|
|000042b0| 09 53 69 7a 65 43 6f 6e | 74 72 6f 6c 28 64 6f 63 |.SizeCon|trol(doc|
|000042c0| 56 53 63 72 6f 6c 6c 2c | 20 6b 53 63 72 6f 6c 6c |VScroll,| kScroll|
|000042d0| 62 61 72 57 69 64 74 68 | 2c 20 28 62 6f 74 74 6f |barWidth|, (botto|
|000042e0| 6d 20 2d 20 74 6f 70 29 | 20 2d 0d 09 09 09 09 09 |m - top)| -......|
|000042f0| 09 28 6b 53 63 72 6f 6c | 6c 62 61 72 41 64 6a 75 |.(kScrol|lbarAdju|
|00004300| 73 74 20 2d 20 6b 53 63 | 72 6f 6c 6c 54 77 65 65 |st - kSc|rollTwee|
|00004310| 6b 29 29 3b 0d 09 09 4d | 6f 76 65 43 6f 6e 74 72 |k));...M|oveContr|
|00004320| 6f 6c 28 64 6f 63 48 53 | 63 72 6f 6c 6c 2c 20 2d |ol(docHS|croll, -|
|00004330| 31 2c 20 62 6f 74 74 6f | 6d 20 2d 20 6b 53 63 72 |1, botto|m - kScr|
|00004340| 6f 6c 6c 62 61 72 41 64 | 6a 75 73 74 29 3b 0d 09 |ollbarAd|just);..|
|00004350| 09 53 69 7a 65 43 6f 6e | 74 72 6f 6c 28 64 6f 63 |.SizeCon|trol(doc|
|00004360| 48 53 63 72 6f 6c 6c 2c | 20 28 72 69 67 68 74 20 |HScroll,| (right |
|00004370| 2d 20 6c 65 66 74 29 20 | 2d 20 28 6b 53 63 72 6f |- left) |- (kScro|
|00004380| 6c 6c 62 61 72 41 64 6a | 75 73 74 20 2d 0d 09 09 |llbarAdj|ust -...|
|00004390| 09 09 09 09 6b 53 63 72 | 6f 6c 6c 54 77 65 65 6b |....kScr|ollTweek|
|000043a0| 29 2c 20 6b 53 63 72 6f | 6c 6c 62 61 72 57 69 64 |), kScro|llbarWid|
|000043b0| 74 68 29 3b 0d 09 45 4e | 44 3b 0d 45 4e 44 3b 20 |th);..EN|D;.END; |
|000043c0| 7b 41 64 6a 75 73 74 53 | 63 72 6f 6c 6c 53 69 7a |{AdjustS|crollSiz|
|000043d0| 65 73 7d 0d 0d 0d 7b 24 | 53 20 4d 61 69 6e 7d 0d |es}...{$|S Main}.|
|000043e0| 50 52 4f 43 45 44 55 52 | 45 20 41 64 6a 75 73 74 |PROCEDUR|E Adjust|
|000043f0| 53 63 72 6f 6c 6c 62 61 | 72 73 28 77 69 6e 64 6f |Scrollba|rs(windo|
|00004400| 77 3a 20 57 69 6e 64 6f | 77 50 74 72 3b 20 6e 65 |w: Windo|wPtr; ne|
|00004410| 65 64 73 52 65 73 69 7a | 65 3a 20 42 4f 4f 4c 45 |edsResiz|e: BOOLE|
|00004420| 41 4e 29 3b 0d 0d 7b 54 | 75 72 6e 20 6f 66 66 20 |AN);..{T|urn off |
|00004430| 74 68 65 20 63 6f 6e 74 | 72 6f 6c 73 20 62 79 20 |the cont|rols by |
|00004440| 6a 61 6d 6d 69 6e 67 20 | 61 20 7a 65 72 6f 20 69 |jamming |a zero i|
|00004450| 6e 74 6f 20 74 68 65 69 | 72 20 63 6f 6e 74 72 6c |nto thei|r contrl|
|00004460| 56 69 73 20 66 69 65 6c | 64 73 20 28 48 69 64 65 |Vis fiel|ds (Hide|
|00004470| 43 6f 6e 74 72 6f 6c 20 | 65 72 61 73 65 73 20 74 |Control |erases t|
|00004480| 68 65 6d 0d 61 6e 64 20 | 77 65 20 64 6f 6e 27 74 |hem.and |we don't|
|00004490| 20 77 61 6e 74 20 74 68 | 61 74 29 2e 20 49 66 20 | want th|at). If |
|000044a0| 74 68 65 20 63 6f 6e 74 | 72 6f 6c 73 20 61 72 65 |the cont|rols are|
|000044b0| 20 74 6f 20 62 65 20 72 | 65 73 69 7a 65 64 20 61 | to be r|esized a|
|000044c0| 73 20 77 65 6c 6c 2c 20 | 63 61 6c 6c 20 74 68 65 |s well, |call the|
|000044d0| 20 70 72 6f 63 65 64 75 | 72 65 20 74 6f 20 64 6f | procedu|re to do|
|000044e0| 20 74 68 61 74 2c 0d 74 | 68 65 6e 20 63 61 6c 6c | that,.t|hen call|
|000044f0| 20 74 68 65 20 70 72 6f | 63 65 64 75 72 65 20 74 | the pro|cedure t|
|00004500| 6f 20 61 64 6a 75 73 74 | 20 74 68 65 20 6d 61 78 |o adjust| the max|
|00004510| 69 6d 75 6d 20 61 6e 64 | 20 63 75 72 72 65 6e 74 |imum and| current|
|00004520| 20 76 61 6c 75 65 73 2e | 20 46 69 6e 61 6c 6c 79 | values.| Finally|
|00004530| 20 72 65 2d 65 6e 61 62 | 6c 65 20 74 68 65 20 63 | re-enab|le the c|
|00004540| 6f 6e 74 72 6f 6c 73 0d | 62 79 20 6a 61 6d 6d 69 |ontrols.|by jammi|
|00004550| 6e 67 20 61 20 24 46 46 | 20 69 6e 20 74 68 65 69 |ng a $FF| in thei|
|00004560| 72 20 63 6f 6e 74 72 6c | 56 69 73 20 66 69 65 6c |r contrl|Vis fiel|
|00004570| 64 73 2e 7d 0d 0d 56 41 | 52 0d 09 6f 6c 64 4d 61 |ds.}..VA|R..oldMa|
|00004580| 78 2c 20 6f 6c 64 56 61 | 6c 09 3a 20 49 4e 54 45 |x, oldVa|l.: INTE|
|00004590| 47 45 52 3b 0d 42 45 47 | 49 4e 0d 09 57 49 54 48 |GER;.BEG|IN..WITH|
|000045a0| 20 44 6f 63 75 6d 65 6e | 74 50 65 65 6b 28 77 69 | Documen|tPeek(wi|
|000045b0| 6e 64 6f 77 29 5e 20 44 | 4f 20 42 45 47 49 4e 0d |ndow)^ D|O BEGIN.|
|000045c0| 09 09 7b 46 69 72 73 74 | 2c 20 74 75 72 6e 20 76 |..{First|, turn v|
|000045d0| 69 73 69 62 69 6c 69 74 | 79 20 6f 66 20 73 63 72 |isibilit|y of scr|
|000045e0| 6f 6c 6c 62 61 72 73 20 | 6f 66 66 20 73 6f 20 77 |ollbars |off so w|
|000045f0| 65 20 77 6f 6e d5 74 20 | 67 65 74 20 75 6e 77 61 |e won.t |get unwa|
|00004600| 6e 74 65 64 20 72 65 64 | 72 61 77 69 6e 67 7d 0d |nted red|rawing}.|
|00004610| 09 09 64 6f 63 56 53 63 | 72 6f 6c 6c 5e 5e 2e 63 |..docVSc|roll^^.c|
|00004620| 6f 6e 74 72 6c 56 69 73 | 20 3a 3d 20 6b 43 6f 6e |ontrlVis| := kCon|
|00004630| 74 72 6f 6c 49 6e 76 69 | 73 69 62 6c 65 3b 09 7b |trolInvi|sible;.{|
|00004640| 74 75 72 6e 20 74 68 65 | 6d 20 6f 66 66 7d 0d 09 |turn the|m off}..|
|00004650| 09 64 6f 63 48 53 63 72 | 6f 6c 6c 5e 5e 2e 63 6f |.docHScr|oll^^.co|
|00004660| 6e 74 72 6c 56 69 73 20 | 3a 3d 20 6b 43 6f 6e 74 |ntrlVis |:= kCont|
|00004670| 72 6f 6c 49 6e 76 69 73 | 69 62 6c 65 3b 0d 09 09 |rolInvis|ible;...|
|00004680| 49 46 20 6e 65 65 64 73 | 52 65 73 69 7a 65 20 54 |IF needs|Resize T|
|00004690| 48 45 4e 09 09 09 09 09 | 09 09 09 7b 6d 6f 76 65 |HEN.....|...{move|
|000046a0| 20 61 6e 64 20 73 69 7a | 65 20 69 66 20 6e 65 65 | and siz|e if nee|
|000046b0| 64 65 64 7d 0d 09 09 09 | 41 64 6a 75 73 74 53 63 |ded}....|AdjustSc|
|000046c0| 72 6f 6c 6c 53 69 7a 65 | 73 28 77 69 6e 64 6f 77 |rollSize|s(window|
|000046d0| 29 3b 0d 09 09 41 64 6a | 75 73 74 53 63 72 6f 6c |);...Adj|ustScrol|
|000046e0| 6c 56 61 6c 75 65 73 28 | 77 69 6e 64 6f 77 2c 20 |lValues(|window, |
|000046f0| 4e 4f 54 20 6e 65 65 64 | 73 52 65 73 69 7a 65 29 |NOT need|sResize)|
|00004700| 3b 09 7b 66 6f 6f 6c 20 | 77 69 74 68 20 6d 61 78 |;.{fool |with max|
|00004710| 20 61 6e 64 20 63 75 72 | 72 65 6e 74 20 76 61 6c | and cur|rent val|
|00004720| 75 65 7d 0d 09 09 7b 4e | 6f 77 2c 20 72 65 73 74 |ue}...{N|ow, rest|
|00004730| 6f 72 65 20 76 69 73 69 | 62 69 6c 69 74 79 20 69 |ore visi|bility i|
|00004740| 6e 20 63 61 73 65 20 77 | 65 20 6e 65 76 65 72 20 |n case w|e never |
|00004750| 68 61 64 20 74 6f 20 53 | 68 6f 77 43 6f 6e 74 72 |had to S|howContr|
|00004760| 6f 6c 20 64 75 72 69 6e | 67 20 61 64 6a 75 73 74 |ol durin|g adjust|
|00004770| 6d 65 6e 74 7d 0d 09 09 | 64 6f 63 56 53 63 72 6f |ment}...|docVScro|
|00004780| 6c 6c 5e 5e 2e 63 6f 6e | 74 72 6c 56 69 73 20 3a |ll^^.con|trlVis :|
|00004790| 3d 20 6b 43 6f 6e 74 72 | 6f 6c 56 69 73 69 62 6c |= kContr|olVisibl|
|000047a0| 65 3b 09 09 7b 74 75 72 | 6e 20 74 68 65 6d 20 6f |e;..{tur|n them o|
|000047b0| 6e 7d 0d 09 09 64 6f 63 | 48 53 63 72 6f 6c 6c 5e |n}...doc|HScroll^|
|000047c0| 5e 2e 63 6f 6e 74 72 6c | 56 69 73 20 3a 3d 20 6b |^.contrl|Vis := k|
|000047d0| 43 6f 6e 74 72 6f 6c 56 | 69 73 69 62 6c 65 3b 0d |ControlV|isible;.|
|000047e0| 09 45 4e 44 3b 0d 45 4e | 44 3b 20 7b 41 64 6a 75 |.END;.EN|D; {Adju|
|000047f0| 73 74 53 63 72 6f 6c 6c | 62 61 72 73 7d 0d 0d 0d |stScroll|bars}...|
|00004800| 7b 24 53 20 4d 61 69 6e | 7d 0d 7b 24 50 55 53 48 |{$S Main|}.{$PUSH|
|00004810| 7d 20 7b 24 5a 2b 7d 0d | 50 52 4f 43 45 44 55 52 |} {$Z+}.|PROCEDUR|
|00004820| 45 20 50 61 73 63 61 6c | 43 6c 69 6b 4c 6f 6f 70 |E Pascal|ClikLoop|
|00004830| 3b 0d 0d 7b 47 65 74 73 | 20 63 61 6c 6c 65 64 20 |;..{Gets| called |
|00004840| 66 72 6f 6d 20 6f 75 72 | 20 61 73 73 65 6d 62 6c |from our| assembl|
|00004850| 79 20 6c 61 6e 67 75 61 | 67 65 20 72 6f 75 74 69 |y langua|ge routi|
|00004860| 6e 65 2c 20 41 73 6d 43 | 6c 69 6b 4c 6f 6f 70 2c |ne, AsmC|likLoop,|
|00004870| 20 77 68 69 63 68 20 69 | 73 20 69 6e 0d 20 74 75 | which i|s in. tu|
|00004880| 72 6e 20 63 61 6c 6c 65 | 64 20 62 79 20 74 68 65 |rn calle|d by the|
|00004890| 20 54 45 43 6c 69 63 6b | 20 74 6f 6f 6c 62 6f 78 | TEClick| toolbox|
|000048a0| 20 72 6f 75 74 69 6e 65 | 2e 20 53 61 76 65 73 20 | routine|. Saves |
|000048b0| 74 68 65 20 77 69 6e 64 | 6f 77 73 20 63 6c 69 70 |the wind|ows clip|
|000048c0| 20 72 65 67 69 6f 6e 2c | 0d 20 73 65 74 73 20 69 | region,|. sets i|
|000048d0| 74 20 74 6f 20 74 68 65 | 20 70 6f 72 74 52 65 63 |t to the| portRec|
|000048e0| 74 2c 20 61 64 6a 75 73 | 74 73 20 74 68 65 20 73 |t, adjus|ts the s|
|000048f0| 63 72 6f 6c 6c 62 61 72 | 20 76 61 6c 75 65 73 20 |crollbar| values |
|00004900| 74 6f 20 6d 61 74 63 68 | 20 74 68 65 20 54 45 20 |to match| the TE |
|00004910| 73 63 72 6f 6c 6c 0d 20 | 61 6d 6f 75 6e 74 2c 20 |scroll. |amount, |
|00004920| 74 68 65 6e 20 72 65 73 | 74 6f 72 65 73 20 74 68 |then res|tores th|
|00004930| 65 20 63 6c 69 70 20 72 | 65 67 69 6f 6e 2e 7d 0d |e clip r|egion.}.|
|00004940| 0d 56 41 52 0d 09 77 69 | 6e 64 6f 77 09 3a 20 57 |.VAR..wi|ndow.: W|
|00004950| 69 6e 64 6f 77 50 74 72 | 3b 0d 09 72 65 67 69 6f |indowPtr|;..regio|
|00004960| 6e 09 3a 20 52 67 6e 48 | 61 6e 64 6c 65 3b 0d 42 |n.: RgnH|andle;.B|
|00004970| 45 47 49 4e 0d 09 77 69 | 6e 64 6f 77 20 3a 3d 20 |EGIN..wi|ndow := |
|00004980| 46 72 6f 6e 74 57 69 6e | 64 6f 77 3b 0d 09 72 65 |FrontWin|dow;..re|
|00004990| 67 69 6f 6e 20 3a 3d 20 | 4e 65 77 52 67 6e 3b 0d |gion := |NewRgn;.|
|000049a0| 09 47 65 74 43 6c 69 70 | 28 72 65 67 69 6f 6e 29 |.GetClip|(region)|
|000049b0| 3b 09 09 09 09 09 7b 73 | 61 76 65 20 74 68 65 20 |;.....{s|ave the |
|000049c0| 6f 6c 64 20 63 6c 69 70 | 7d 0d 09 43 6c 69 70 52 |old clip|}..ClipR|
|000049d0| 65 63 74 28 77 69 6e 64 | 6f 77 5e 2e 70 6f 72 74 |ect(wind|ow^.port|
|000049e0| 52 65 63 74 29 3b 09 09 | 09 7b 73 65 74 20 74 68 |Rect);..|.{set th|
|000049f0| 65 20 6e 65 77 20 63 6c | 69 70 7d 0d 09 41 64 6a |e new cl|ip}..Adj|
|00004a00| 75 73 74 53 63 72 6f 6c | 6c 56 61 6c 75 65 73 28 |ustScrol|lValues(|
|00004a10| 77 69 6e 64 6f 77 2c 20 | 54 52 55 45 29 3b 09 7b |window, |TRUE);.{|
|00004a20| 70 61 73 73 20 54 52 55 | 45 20 66 6f 72 20 63 61 |pass TRU|E for ca|
|00004a30| 6e 52 65 64 72 61 77 7d | 0d 09 53 65 74 43 6c 69 |nRedraw}|..SetCli|
|00004a40| 70 28 72 65 67 69 6f 6e | 29 3b 09 09 09 09 09 7b |p(region|);.....{|
|00004a50| 72 65 73 74 6f 72 65 20 | 74 68 65 20 6f 6c 64 20 |restore |the old |
|00004a60| 63 6c 69 70 7d 0d 09 44 | 69 73 70 6f 73 65 52 67 |clip}..D|isposeRg|
|00004a70| 6e 28 72 65 67 69 6f 6e | 29 3b 0d 45 4e 44 3b 20 |n(region|);.END; |
|00004a80| 7b 50 61 73 63 61 6c 43 | 6c 69 6b 4c 6f 6f 70 7d |{PascalC|likLoop}|
|00004a90| 0d 7b 24 50 4f 50 7d 0d | 0d 0d 7b 24 53 20 4d 61 |.{$POP}.|..{$S Ma|
|00004aa0| 69 6e 7d 0d 7b 24 50 55 | 53 48 7d 20 7b 24 5a 2b |in}.{$PU|SH} {$Z+|
|00004ab0| 7d 0d 46 55 4e 43 54 49 | 4f 4e 20 47 65 74 4f 6c |}.FUNCTI|ON GetOl|
|00004ac0| 64 43 6c 69 6b 4c 6f 6f | 70 20 3a 20 50 72 6f 63 |dClikLoo|p : Proc|
|00004ad0| 50 74 72 3b 0d 0d 7b 47 | 65 74 73 20 63 61 6c 6c |Ptr;..{G|ets call|
|00004ae0| 65 64 20 66 72 6f 6d 20 | 6f 75 72 20 61 73 73 65 |ed from |our asse|
|00004af0| 6d 62 6c 79 20 6c 61 6e | 67 75 61 67 65 20 72 6f |mbly lan|guage ro|
|00004b00| 75 74 69 6e 65 2c 20 41 | 73 6d 43 6c 69 6b 4c 6f |utine, A|smClikLo|
|00004b10| 6f 70 2c 20 77 68 69 63 | 68 20 69 73 20 69 6e 0d |op, whic|h is in.|
|00004b20| 74 75 72 6e 20 63 61 6c | 6c 65 64 20 62 79 20 74 |turn cal|led by t|
|00004b30| 68 65 20 54 45 43 6c 69 | 63 6b 20 74 6f 6f 6c 62 |he TECli|ck toolb|
|00004b40| 6f 78 20 72 6f 75 74 69 | 6e 65 2e 20 49 74 20 72 |ox routi|ne. It r|
|00004b50| 65 74 75 72 6e 73 20 74 | 68 65 20 61 64 64 72 65 |eturns t|he addre|
|00004b60| 73 73 20 6f 66 20 74 68 | 65 0d 64 65 66 61 75 6c |ss of th|e.defaul|
|00004b70| 74 20 63 6c 69 6b 4c 6f | 6f 70 20 72 6f 75 74 69 |t clikLo|op routi|
|00004b80| 6e 65 20 74 68 61 74 20 | 77 61 73 20 70 75 74 20 |ne that |was put |
|00004b90| 69 6e 74 6f 20 74 68 65 | 20 54 45 52 65 63 20 62 |into the| TERec b|
|00004ba0| 79 20 54 45 41 75 74 6f | 56 69 65 77 20 74 6f 0d |y TEAuto|View to.|
|00004bb0| 41 73 6d 43 6c 69 6b 4c | 6f 6f 70 20 73 6f 20 74 |AsmClikL|oop so t|
|00004bc0| 68 61 74 20 69 74 20 63 | 61 6e 20 63 61 6c 6c 20 |hat it c|an call |
|00004bd0| 69 74 2e 7d 0d 0d 42 45 | 47 49 4e 0d 09 47 65 74 |it.}..BE|GIN..Get|
|00004be0| 4f 6c 64 43 6c 69 6b 4c | 6f 6f 70 20 3a 3d 20 44 |OldClikL|oop := D|
|00004bf0| 6f 63 75 6d 65 6e 74 50 | 65 65 6b 28 46 72 6f 6e |ocumentP|eek(Fron|
|00004c00| 74 57 69 6e 64 6f 77 29 | 5e 2e 64 6f 63 43 6c 69 |tWindow)|^.docCli|
|00004c10| 6b 3b 0d 45 4e 44 3b 20 | 7b 47 65 74 4f 6c 64 43 |k;.END; |{GetOldC|
|00004c20| 6c 69 6b 4c 6f 6f 70 7d | 0d 7b 24 50 4f 50 7d 0d |likLoop}|.{$POP}.|
|00004c30| 0d 0d 50 52 4f 43 45 44 | 55 52 45 20 41 73 6d 43 |..PROCED|URE AsmC|
|00004c40| 6c 69 6b 4c 6f 6f 70 3b | 20 45 58 54 45 52 4e 41 |likLoop;| EXTERNA|
|00004c50| 4c 3b 0d 0d 7b 41 20 72 | 65 66 65 72 65 6e 63 65 |L;..{A r|eference|
|00004c60| 20 74 6f 20 6f 75 72 20 | 61 73 73 65 6d 62 6c 79 | to our |assembly|
|00004c70| 20 6c 61 6e 67 75 61 67 | 65 20 72 6f 75 74 69 6e | languag|e routin|
|00004c80| 65 20 74 68 61 74 20 67 | 65 74 73 20 61 74 74 61 |e that g|ets atta|
|00004c90| 63 68 65 64 20 74 6f 20 | 74 68 65 20 63 6c 69 6b |ched to |the clik|
|00004ca0| 4c 6f 6f 70 0d 66 69 65 | 6c 64 20 6f 66 20 6f 75 |Loop.fie|ld of ou|
|00004cb0| 72 20 54 45 20 72 65 63 | 6f 72 64 2e 7d 0d 0d 0d |r TE rec|ord.}...|
|00004cc0| 7b 24 53 20 4d 61 69 6e | 7d 0d 50 52 4f 43 45 44 |{$S Main|}.PROCED|
|00004cd0| 55 52 45 20 44 6f 4e 65 | 77 3b 0d 0d 7b 43 72 65 |URE DoNe|w;..{Cre|
|00004ce0| 61 74 65 20 61 20 6e 65 | 77 20 64 6f 63 75 6d 65 |ate a ne|w docume|
|00004cf0| 6e 74 20 61 6e 64 20 77 | 69 6e 64 6f 77 2e 7d 0d |nt and w|indow.}.|
|00004d00| 0d 56 41 52 0d 09 67 6f | 6f 64 2c 20 69 67 6e 6f |.VAR..go|od, igno|
|00004d10| 72 65 09 09 3a 20 42 4f | 4f 4c 45 41 4e 3b 0d 09 |re..: BO|OLEAN;..|
|00004d20| 73 74 6f 72 61 67 65 09 | 09 09 09 3a 20 50 74 72 |storage.|...: Ptr|
|00004d30| 3b 0d 09 77 69 6e 64 6f | 77 09 09 09 09 3a 20 57 |;..windo|w....: W|
|00004d40| 69 6e 64 6f 77 50 74 72 | 3b 0d 09 64 65 73 74 52 |indowPtr|;..destR|
|00004d50| 65 63 74 2c 20 76 69 65 | 77 52 65 63 74 09 3a 20 |ect, vie|wRect.: |
|00004d60| 52 65 63 74 3b 0d 0d 42 | 45 47 49 4e 0d 09 73 74 |Rect;..B|EGIN..st|
|00004d70| 6f 72 61 67 65 20 3a 3d | 20 4e 65 77 50 74 72 28 |orage :=| NewPtr(|
|00004d80| 53 49 5a 45 4f 46 28 44 | 6f 63 75 6d 65 6e 74 52 |SIZEOF(D|ocumentR|
|00004d90| 65 63 6f 72 64 29 29 3b | 0d 09 49 46 20 73 74 6f |ecord));|..IF sto|
|00004da0| 72 61 67 65 20 3c 3e 20 | 4e 49 4c 20 54 48 45 4e |rage <> |NIL THEN|
|00004db0| 20 42 45 47 49 4e 0d 09 | 09 77 69 6e 64 6f 77 20 | BEGIN..|.window |
|00004dc0| 3a 3d 20 47 65 74 4e 65 | 77 57 69 6e 64 6f 77 28 |:= GetNe|wWindow(|
|00004dd0| 72 44 6f 63 57 69 6e 64 | 6f 77 2c 20 73 74 6f 72 |rDocWind|ow, stor|
|00004de0| 61 67 65 2c 20 57 69 6e | 64 6f 77 50 74 72 28 2d |age, Win|dowPtr(-|
|00004df0| 31 29 29 3b 0d 09 09 49 | 46 20 77 69 6e 64 6f 77 |1));...I|F window|
|00004e00| 20 3c 3e 20 4e 49 4c 20 | 54 48 45 4e 20 42 45 47 | <> NIL |THEN BEG|
|00004e10| 49 4e 0d 09 09 09 67 4e | 75 6d 44 6f 63 75 6d 65 |IN....gN|umDocume|
|00004e20| 6e 74 73 20 3a 3d 20 67 | 4e 75 6d 44 6f 63 75 6d |nts := g|NumDocum|
|00004e30| 65 6e 74 73 20 2b 20 31 | 3b 09 7b 74 68 69 73 20 |ents + 1|;.{this |
|00004e40| 77 69 6c 6c 20 62 65 20 | 64 65 63 72 65 6d 65 6e |will be |decremen|
|00004e50| 74 65 64 20 77 68 65 6e | 20 77 65 20 63 61 6c 6c |ted when| we call|
|00004e60| 20 44 6f 43 6c 6f 73 65 | 57 69 6e 64 6f 77 7d 0d | DoClose|Window}.|
|00004e70| 09 09 09 67 6f 6f 64 20 | 3a 3d 20 46 41 4c 53 45 |...good |:= FALSE|
|00004e80| 3b 0d 09 09 09 53 65 74 | 50 6f 72 74 28 77 69 6e |;....Set|Port(win|
|00004e90| 64 6f 77 29 3b 0d 09 09 | 09 57 49 54 48 20 77 69 |dow);...|.WITH wi|
|00004ea0| 6e 64 6f 77 5e 2c 20 44 | 6f 63 75 6d 65 6e 74 50 |ndow^, D|ocumentP|
|00004eb0| 65 65 6b 28 77 69 6e 64 | 6f 77 29 5e 20 44 4f 20 |eek(wind|ow)^ DO |
|00004ec0| 42 45 47 49 4e 0d 09 09 | 09 09 47 65 74 54 45 52 |BEGIN...|..GetTER|
|00004ed0| 65 63 74 28 77 69 6e 64 | 6f 77 2c 20 76 69 65 77 |ect(wind|ow, view|
|00004ee0| 52 65 63 74 29 3b 0d 09 | 09 09 09 64 65 73 74 52 |Rect);..|...destR|
|00004ef0| 65 63 74 20 3a 3d 20 76 | 69 65 77 52 65 63 74 3b |ect := v|iewRect;|
|00004f00| 0d 09 09 09 09 64 65 73 | 74 52 65 63 74 2e 72 69 |.....des|tRect.ri|
|00004f10| 67 68 74 20 3a 3d 20 64 | 65 73 74 52 65 63 74 2e |ght := d|estRect.|
|00004f20| 6c 65 66 74 20 2b 20 6b | 4d 61 78 44 6f 63 57 69 |left + k|MaxDocWi|
|00004f30| 64 74 68 3b 0d 09 09 09 | 09 64 6f 63 54 45 20 3a |dth;....|.docTE :|
|00004f40| 3d 20 54 45 4e 65 77 28 | 64 65 73 74 52 65 63 74 |= TENew(|destRect|
|00004f50| 2c 20 76 69 65 77 52 65 | 63 74 29 3b 0d 09 09 09 |, viewRe|ct);....|
|00004f60| 09 41 64 6a 75 73 74 56 | 69 65 77 52 65 63 74 28 |.AdjustV|iewRect(|
|00004f70| 64 6f 63 54 45 29 3b 0d | 09 09 09 09 54 45 41 75 |docTE);.|....TEAu|
|00004f80| 74 6f 56 69 65 77 28 54 | 52 55 45 2c 20 64 6f 63 |toView(T|RUE, doc|
|00004f90| 54 45 29 3b 0d 09 09 09 | 09 64 6f 63 43 6c 69 6b |TE);....|.docClik|
|00004fa0| 20 3a 3d 20 64 6f 63 54 | 45 5e 5e 2e 63 6c 69 6b | := docT|E^^.clik|
|00004fb0| 4c 6f 6f 70 3b 0d 09 09 | 09 09 64 6f 63 54 45 5e |Loop;...|..docTE^|
|00004fc0| 5e 2e 63 6c 69 6b 4c 6f | 6f 70 20 3a 3d 20 40 41 |^.clikLo|op := @A|
|00004fd0| 73 6d 43 6c 69 6b 4c 6f | 6f 70 3b 0d 09 09 09 09 |smClikLo|op;.....|
|00004fe0| 49 46 20 64 6f 63 54 45 | 20 3c 3e 20 4e 49 4c 20 |IF docTE| <> NIL |
|00004ff0| 54 48 45 4e 0d 09 09 09 | 09 09 67 6f 6f 64 20 3a |THEN....|..good :|
|00005000| 3d 20 54 52 55 45 3b 09 | 09 09 09 7b 69 66 20 54 |= TRUE;.|...{if T|
|00005010| 45 4e 65 77 20 73 75 63 | 63 65 65 64 65 64 2c 20 |ENew suc|ceeded, |
|00005020| 77 65 20 68 61 76 65 20 | 61 20 67 6f 6f 64 20 64 |we have |a good d|
|00005030| 6f 63 75 6d 65 6e 74 7d | 0d 09 09 09 09 49 46 20 |ocument}|.....IF |
|00005040| 67 6f 6f 64 20 54 48 45 | 4e 20 42 45 47 49 4e 0d |good THE|N BEGIN.|
|00005050| 09 09 09 09 09 64 6f 63 | 56 53 63 72 6f 6c 6c 20 |.....doc|VScroll |
|00005060| 3a 3d 20 47 65 74 4e 65 | 77 43 6f 6e 74 72 6f 6c |:= GetNe|wControl|
|00005070| 28 72 56 53 63 72 6f 6c | 6c 2c 20 77 69 6e 64 6f |(rVScrol|l, windo|
|00005080| 77 29 3b 0d 09 09 09 09 | 09 67 6f 6f 64 20 3a 3d |w);.....|.good :=|
|00005090| 20 28 64 6f 63 56 53 63 | 72 6f 6c 6c 20 3c 3e 20 | (docVSc|roll <> |
|000050a0| 4e 49 4c 29 3b 0d 09 09 | 09 09 45 4e 44 3b 0d 09 |NIL);...|..END;..|
|000050b0| 09 09 09 49 46 20 67 6f | 6f 64 20 54 48 45 4e 20 |...IF go|od THEN |
|000050c0| 42 45 47 49 4e 0d 09 09 | 09 09 09 64 6f 63 48 53 |BEGIN...|...docHS|
|000050d0| 63 72 6f 6c 6c 20 3a 3d | 20 47 65 74 4e 65 77 43 |croll :=| GetNewC|
|000050e0| 6f 6e 74 72 6f 6c 28 72 | 48 53 63 72 6f 6c 6c 2c |ontrol(r|HScroll,|
|000050f0| 20 77 69 6e 64 6f 77 29 | 3b 0d 09 09 09 09 09 67 | window)|;......g|
|00005100| 6f 6f 64 20 3a 3d 20 28 | 64 6f 63 48 53 63 72 6f |ood := (|docHScro|
|00005110| 6c 6c 20 3c 3e 20 4e 49 | 4c 29 3b 0d 09 09 09 09 |ll <> NI|L);.....|
|00005120| 45 4e 44 3b 0d 09 09 09 | 09 49 46 20 67 6f 6f 64 |END;....|.IF good|
|00005130| 20 54 48 45 4e 20 42 45 | 47 49 4e 0d 09 09 09 09 | THEN BE|GIN.....|
|00005140| 09 7b 46 41 4c 53 45 20 | 74 6f 20 41 64 6a 75 73 |.{FALSE |to Adjus|
|00005150| 74 53 63 72 6f 6c 6c 56 | 61 6c 75 65 73 20 6d 65 |tScrollV|alues me|
|00005160| 61 6e 73 20 6d 75 73 6e | d5 74 20 72 65 64 72 61 |ans musn|.t redra|
|00005170| 77 3b 20 74 65 63 68 6e | 69 63 61 6c 6c 79 2c 20 |w; techn|ically, |
|00005180| 6f 66 20 63 6f 75 72 73 | 65 2c 0d 09 09 09 09 09 |of cours|e,......|
|00005190| 74 68 65 20 77 69 6e 64 | 6f 77 20 69 73 20 68 69 |the wind|ow is hi|
|000051a0| 64 64 65 6e 20 73 6f 20 | 69 74 20 77 6f 75 6c 64 |dden so |it would|
|000051b0| 6e d5 74 20 6d 61 74 74 | 65 72 20 77 68 65 74 68 |n.t matt|er wheth|
|000051c0| 65 72 20 77 65 20 63 61 | 6c 6c 65 64 20 53 68 6f |er we ca|lled Sho|
|000051d0| 77 43 6f 6e 74 72 6f 6c | 20 6f 72 20 6e 6f 74 2e |wControl| or not.|
|000051e0| 7d 0d 09 09 09 09 09 41 | 64 6a 75 73 74 53 63 72 |}......A|djustScr|
|000051f0| 6f 6c 6c 56 61 6c 75 65 | 73 28 77 69 6e 64 6f 77 |ollValue|s(window|
|00005200| 2c 20 46 41 4c 53 45 29 | 3b 0d 09 09 09 09 09 53 |, FALSE)|;......S|
|00005210| 68 6f 77 57 69 6e 64 6f | 77 28 77 69 6e 64 6f 77 |howWindo|w(window|
|00005220| 29 3b 09 09 09 7b 69 66 | 20 74 68 65 20 64 6f 63 |);...{if| the doc|
|00005230| 75 6d 65 6e 74 20 69 73 | 20 67 6f 6f 64 2c 20 6d |ument is| good, m|
|00005240| 61 6b 65 20 74 68 65 20 | 77 69 6e 64 6f 77 20 76 |ake the |window v|
|00005250| 69 73 69 62 6c 65 7d 0d | 09 09 09 09 45 4e 44 20 |isible}.|....END |
|00005260| 45 4c 53 45 20 42 45 47 | 49 4e 0d 09 09 09 09 09 |ELSE BEG|IN......|
|00005270| 69 67 6e 6f 72 65 20 3a | 3d 20 44 6f 43 6c 6f 73 |ignore :|= DoClos|
|00005280| 65 57 69 6e 64 6f 77 28 | 77 69 6e 64 6f 77 29 3b |eWindow(|window);|
|00005290| 09 7b 6f 74 68 65 72 77 | 69 73 65 20 72 65 67 72 |.{otherw|ise regr|
|000052a0| 65 74 20 77 65 20 65 76 | 65 72 20 63 72 65 61 74 |et we ev|er creat|
|000052b0| 65 64 20 69 74 2e 2e 2e | 7d 0d 09 09 09 09 09 41 |ed it...|}......A|
|000052c0| 6c 65 72 74 55 73 65 72 | 28 65 4e 6f 57 69 6e 64 |lertUser|(eNoWind|
|000052d0| 6f 77 29 3b 09 09 09 09 | 7b 61 6e 64 20 74 65 6c |ow);....|{and tel|
|000052e0| 6c 20 75 73 65 72 7d 0d | 09 09 09 09 45 4e 44 0d |l user}.|....END.|
|000052f0| 09 09 09 45 4e 44 3b 0d | 09 09 45 4e 44 20 45 4c |...END;.|..END EL|
|00005300| 53 45 0d 09 09 09 44 69 | 73 70 6f 73 50 74 72 28 |SE....Di|sposPtr(|
|00005310| 73 74 6f 72 61 67 65 29 | 3b 09 09 09 09 09 7b 67 |storage)|;.....{g|
|00005320| 65 74 20 72 69 64 20 6f | 66 20 74 68 65 20 73 74 |et rid o|f the st|
|00005330| 6f 72 61 67 65 20 69 66 | 20 69 74 20 69 73 20 6e |orage if| it is n|
|00005340| 65 76 65 72 20 75 73 65 | 64 7d 0d 09 45 4e 44 3b |ever use|d}..END;|
|00005350| 0d 45 4e 44 3b 20 7b 44 | 6f 4e 65 77 7d 0d 0d 0d |.END; {D|oNew}...|
|00005360| 7b 24 53 20 4d 61 69 6e | 7d 0d 50 52 4f 43 45 44 |{$S Main|}.PROCED|
|00005370| 55 52 45 20 42 69 67 42 | 61 64 45 72 72 6f 72 28 |URE BigB|adError(|
|00005380| 65 72 72 6f 72 3a 20 49 | 4e 54 45 47 45 52 29 3b |error: I|NTEGER);|
|00005390| 0d 42 45 47 49 4e 0d 09 | 41 6c 65 72 74 55 73 65 |.BEGIN..|AlertUse|
|000053a0| 72 28 65 72 72 6f 72 29 | 3b 0d 09 45 78 69 74 54 |r(error)|;..ExitT|
|000053b0| 6f 53 68 65 6c 6c 3b 0d | 45 4e 44 3b 0d 0d 0d 7b |oShell;.|END;...{|
|000053c0| 24 53 20 49 6e 69 74 69 | 61 6c 69 7a 65 7d 0d 50 |$S Initi|alize}.P|
|000053d0| 52 4f 43 45 44 55 52 45 | 20 49 6e 69 74 69 61 6c |ROCEDURE| Initial|
|000053e0| 69 7a 65 3b 0d 0d 7b 53 | 65 74 20 75 70 20 74 68 |ize;..{S|et up th|
|000053f0| 65 20 77 68 6f 6c 65 20 | 77 6f 72 6c 64 2c 20 69 |e whole |world, i|
|00005400| 6e 63 6c 75 64 69 6e 67 | 20 67 6c 6f 62 61 6c 20 |ncluding| global |
|00005410| 76 61 72 69 61 62 6c 65 | 73 2c 20 54 6f 6f 6c 62 |variable|s, Toolb|
|00005420| 6f 78 20 6d 61 6e 61 67 | 65 72 73 2c 0d 20 6d 65 |ox manag|ers,. me|
|00005430| 6e 75 73 2c 20 61 6e 64 | 20 61 20 73 69 6e 67 6c |nus, and| a singl|
|00005440| 65 20 62 6c 61 6e 6b 20 | 64 6f 63 75 6d 65 6e 74 |e blank |document|
|00005450| 2e 7d 0d 0d 7b 31 2e 30 | 31 20 2d 20 54 68 65 20 |.}..{1.0|1 - The |
|00005460| 63 6f 64 65 20 74 68 61 | 74 20 75 73 65 64 20 74 |code tha|t used t|
|00005470| 6f 20 62 65 20 70 61 72 | 74 20 6f 66 20 46 6f 72 |o be par|t of For|
|00005480| 63 65 45 6e 76 69 72 6f | 6e 73 20 68 61 73 20 62 |ceEnviro|ns has b|
|00005490| 65 65 6e 20 6d 6f 76 65 | 64 20 69 6e 74 6f 0d 20 |een move|d into. |
|000054a0| 74 68 69 73 20 6d 6f 64 | 75 6c 65 2e 20 49 66 20 |this mod|ule. If |
|000054b0| 61 6e 20 65 72 72 6f 72 | 20 69 73 20 64 65 74 65 |an error| is dete|
|000054c0| 63 74 65 64 2c 20 69 6e | 73 74 65 61 64 20 6f 66 |cted, in|stead of|
|000054d0| 20 6d 65 72 65 6c 79 20 | 64 6f 69 6e 67 20 61 6e | merely |doing an|
|000054e0| 20 45 78 69 74 54 6f 53 | 68 65 6c 6c 2c 0d 20 77 | ExitToS|hell,. w|
|000054f0| 68 69 63 68 20 6c 65 61 | 76 65 73 20 74 68 65 20 |hich lea|ves the |
|00005500| 75 73 65 72 20 77 69 74 | 68 6f 75 74 20 6d 75 63 |user wit|hout muc|
|00005510| 68 20 74 6f 20 67 6f 20 | 6f 6e 2c 20 77 65 20 63 |h to go |on, we c|
|00005520| 61 6c 6c 20 41 6c 65 72 | 74 55 73 65 72 2c 20 77 |all Aler|tUser, w|
|00005530| 68 69 63 68 20 70 75 74 | 73 0d 20 75 70 20 61 20 |hich put|s. up a |
|00005540| 73 69 6d 70 6c 65 20 61 | 6c 65 72 74 20 74 68 61 |simple a|lert tha|
|00005550| 74 20 6a 75 73 74 20 73 | 61 79 73 20 61 6e 20 65 |t just s|ays an e|
|00005560| 72 72 6f 72 20 6f 63 63 | 75 72 72 65 64 20 61 6e |rror occ|urred an|
|00005570| 64 20 74 68 65 6e 20 63 | 61 6c 6c 73 20 45 78 69 |d then c|alls Exi|
|00005580| 74 54 6f 53 68 65 6c 6c | 2e 0d 20 53 69 6e 63 65 |tToShell|.. Since|
|00005590| 20 74 68 65 72 65 20 69 | 73 20 6e 6f 20 6f 74 68 | there i|s no oth|
|000055a0| 65 72 20 63 6c 65 61 6e | 75 70 20 6e 65 65 64 65 |er clean|up neede|
|000055b0| 64 20 61 74 20 74 68 69 | 73 20 70 6f 69 6e 74 20 |d at thi|s point |
|000055c0| 69 66 20 61 6e 20 65 72 | 72 6f 72 20 69 73 20 64 |if an er|ror is d|
|000055d0| 65 74 65 63 74 65 64 2c | 0d 20 74 68 69 73 20 66 |etected,|. this f|
|000055e0| 6f 72 6d 20 6f 66 20 65 | 72 72 6f 72 2d 20 68 61 |orm of e|rror- ha|
|000055f0| 6e 64 6c 69 6e 67 20 69 | 73 20 61 63 63 65 70 74 |ndling i|s accept|
|00005600| 61 62 6c 65 2e 20 49 66 | 20 6d 6f 72 65 20 73 6f |able. If| more so|
|00005610| 70 68 69 73 74 69 63 61 | 74 65 64 20 65 72 72 6f |phistica|ted erro|
|00005620| 72 20 72 65 63 6f 76 65 | 72 79 0d 20 69 73 20 6e |r recove|ry. is n|
|00005630| 65 65 64 65 64 2c 20 61 | 6e 20 65 78 63 65 70 74 |eeded, a|n except|
|00005640| 69 6f 6e 20 6d 65 63 68 | 61 6e 69 73 6d 2c 20 73 |ion mech|anism, s|
|00005650| 75 63 68 20 61 73 20 69 | 73 20 70 72 6f 76 69 64 |uch as i|s provid|
|00005660| 65 64 20 62 79 20 53 69 | 67 6e 61 6c 73 2c 20 63 |ed by Si|gnals, c|
|00005670| 61 6e 20 62 65 20 75 73 | 65 64 2e 7d 0d 0d 56 41 |an be us|ed.}..VA|
|00005680| 52 0d 09 6d 65 6e 75 42 | 61 72 09 09 09 09 3a 20 |R..menuB|ar....: |
|00005690| 48 61 6e 64 6c 65 3b 0d | 09 74 6f 74 61 6c 2c 20 |Handle;.|.total, |
|000056a0| 63 6f 6e 74 69 67 09 09 | 3a 20 4c 6f 6e 67 49 6e |contig..|: LongIn|
|000056b0| 74 3b 0d 09 69 67 6e 6f | 72 65 52 65 73 75 6c 74 |t;..igno|reResult|
|000056c0| 09 09 3a 20 42 4f 4f 4c | 45 41 4e 3b 0d 09 65 76 |..: BOOL|EAN;..ev|
|000056d0| 65 6e 74 09 09 09 09 3a | 20 45 76 65 6e 74 52 65 |ent....:| EventRe|
|000056e0| 63 6f 72 64 3b 0d 09 63 | 6f 75 6e 74 2c 20 69 67 |cord;..c|ount, ig|
|000056f0| 6e 6f 72 65 45 72 72 6f | 72 09 3a 20 49 4e 54 45 |noreErro|r.: INTE|
|00005700| 47 45 52 3b 0d 09 0d 09 | 50 52 4f 43 45 44 55 52 |GER;....|PROCEDUR|
|00005710| 45 20 42 69 67 42 61 64 | 45 72 72 6f 72 28 65 72 |E BigBad|Error(er|
|00005720| 72 6f 72 3a 20 49 4e 54 | 45 47 45 52 29 3b 0d 09 |ror: INT|EGER);..|
|00005730| 42 45 47 49 4e 0d 09 09 | 41 6c 65 72 74 55 73 65 |BEGIN...|AlertUse|
|00005740| 72 28 65 72 72 6f 72 29 | 3b 0d 09 09 45 78 69 74 |r(error)|;...Exit|
|00005750| 54 6f 53 68 65 6c 6c 3b | 0d 09 45 4e 44 3b 0d 0d |ToShell;|..END;..|
|00005760| 42 45 47 49 4e 0d 09 67 | 48 61 73 57 61 69 74 4e |BEGIN..g|HasWaitN|
|00005770| 65 78 74 45 76 65 6e 74 | 20 3a 3d 20 54 72 61 70 |extEvent| := Trap|
|00005780| 41 76 61 69 6c 61 62 6c | 65 28 5f 57 61 69 74 4e |Availabl|e(_WaitN|
|00005790| 65 78 74 45 76 65 6e 74 | 2c 20 54 6f 6f 6c 54 72 |extEvent|, ToolTr|
|000057a0| 61 70 29 3b 0d 09 67 49 | 6e 42 61 63 6b 67 72 6f |ap);..gI|nBackgro|
|000057b0| 75 6e 64 20 3a 3d 20 46 | 41 4c 53 45 3b 0d 0d 09 |und := F|ALSE;...|
|000057c0| 49 6e 69 74 47 72 61 66 | 28 40 74 68 65 50 6f 72 |InitGraf|(@thePor|
|000057d0| 74 29 3b 0d 09 49 6e 69 | 74 46 6f 6e 74 73 3b 0d |t);..Ini|tFonts;.|
|000057e0| 09 49 6e 69 74 57 69 6e | 64 6f 77 73 3b 0d 09 49 |.InitWin|dows;..I|
|000057f0| 6e 69 74 4d 65 6e 75 73 | 3b 0d 09 54 45 49 6e 69 |nitMenus|;..TEIni|
|00005800| 74 3b 0d 09 49 6e 69 74 | 44 69 61 6c 6f 67 73 28 |t;..Init|Dialogs(|
|00005810| 4e 49 4c 29 3b 0d 09 49 | 6e 69 74 43 75 72 73 6f |NIL);..I|nitCurso|
|00005820| 72 3b 0d 0d 09 7b 43 61 | 6c 6c 20 4d 50 50 4f 70 |r;...{Ca|ll MPPOp|
|00005830| 65 6e 20 61 6e 64 20 41 | 54 50 4c 6f 61 64 20 61 |en and A|TPLoad a|
|00005840| 74 20 74 68 69 73 20 70 | 6f 69 6e 74 20 74 6f 20 |t this p|oint to |
|00005850| 69 6e 69 74 69 61 6c 69 | 7a 65 20 41 70 70 6c 65 |initiali|ze Apple|
|00005860| 54 61 6c 6b 2c 0d 09 20 | 69 66 20 79 6f 75 20 61 |Talk,.. |if you a|
|00005870| 72 65 20 75 73 69 6e 67 | 20 69 74 2e 7d 0d 09 7b |re using| it.}..{|
|00005880| 4e 4f 54 45 20 2d 2d 20 | 49 74 20 69 73 20 6e 6f |NOTE -- |It is no|
|00005890| 20 6c 6f 6e 67 65 72 20 | 6e 65 63 65 73 73 61 72 | longer |necessar|
|000058a0| 79 2c 20 61 6e 64 20 61 | 63 74 75 61 6c 6c 79 20 |y, and a|ctually |
|000058b0| 75 6e 68 65 61 6c 74 68 | 79 2c 20 74 6f 20 63 68 |unhealth|y, to ch|
|000058c0| 65 63 6b 0d 09 20 50 6f | 72 74 42 55 73 65 20 61 |eck.. Po|rtBUse a|
|000058d0| 6e 64 20 53 50 43 6f 6e | 66 69 67 20 62 65 66 6f |nd SPCon|fig befo|
|000058e0| 72 65 20 6f 70 65 6e 69 | 6e 67 20 41 70 70 6c 65 |re openi|ng Apple|
|000058f0| 54 61 6c 6b 2e 20 54 68 | 65 20 64 72 69 76 65 72 |Talk. Th|e driver|
|00005900| 73 20 61 72 65 20 63 61 | 70 61 62 6c 65 0d 09 20 |s are ca|pable.. |
|00005910| 6f 66 20 63 68 65 63 6b | 69 6e 67 20 66 6f 72 20 |of check|ing for |
|00005920| 70 6f 72 74 20 61 76 61 | 69 6c 61 62 69 6c 69 74 |port ava|ilabilit|
|00005930| 79 20 74 68 65 6d 73 65 | 6c 76 65 73 2e 7d 0d 09 |y themse|lves.}..|
|00005940| 0d 09 7b 54 68 69 73 20 | 6e 65 78 74 20 62 69 74 |..{This |next bit|
|00005950| 20 6f 66 20 63 6f 64 65 | 20 69 73 20 6e 65 63 65 | of code| is nece|
|00005960| 73 73 61 72 79 20 74 6f | 20 61 6c 6c 6f 77 20 74 |ssary to| allow t|
|00005970| 68 65 20 64 65 66 61 75 | 6c 74 20 62 75 74 74 6f |he defau|lt butto|
|00005980| 6e 20 6f 66 20 6f 75 72 | 0d 09 20 61 6c 65 72 74 |n of our|.. alert|
|00005990| 20 62 65 20 6f 75 74 6c | 69 6e 65 64 2e 7d 0d 09 | be outl|ined.}..|
|000059a0| 20 0d 09 46 4f 52 20 63 | 6f 75 6e 74 20 3a 3d 20 | ..FOR c|ount := |
|000059b0| 31 20 54 4f 20 33 20 44 | 4f 0d 09 09 69 67 6e 6f |1 TO 3 D|O...igno|
|000059c0| 72 65 52 65 73 75 6c 74 | 20 3a 3d 20 47 65 74 4e |reResult| := GetN|
|000059d0| 65 78 74 45 76 65 6e 74 | 28 65 76 65 72 79 45 76 |extEvent|(everyEv|
|000059e0| 65 6e 74 2c 20 65 76 65 | 6e 74 29 3b 0d 09 0d 09 |ent, eve|nt);....|
|000059f0| 7b 49 67 6e 6f 72 65 20 | 74 68 65 20 65 72 72 6f |{Ignore |the erro|
|00005a00| 72 20 72 65 74 75 72 6e | 65 64 20 66 72 6f 6d 20 |r return|ed from |
|00005a10| 53 79 73 45 6e 76 69 72 | 6f 6e 73 3b 20 65 76 65 |SysEnvir|ons; eve|
|00005a20| 6e 20 69 66 20 61 6e 20 | 65 72 72 6f 72 20 6f 63 |n if an |error oc|
|00005a30| 63 75 72 72 65 64 2c 0d | 09 20 74 68 65 20 53 79 |curred,.|. the Sy|
|00005a40| 73 45 6e 76 69 72 6f 6e | 73 20 67 6c 75 65 20 77 |sEnviron|s glue w|
|00005a50| 69 6c 6c 20 66 69 6c 6c | 20 69 6e 20 74 68 65 20 |ill fill| in the |
|00005a60| 53 79 73 45 6e 76 52 65 | 63 2e 20 59 6f 75 20 63 |SysEnvRe|c. You c|
|00005a70| 61 6e 20 73 61 76 65 20 | 61 20 72 65 64 75 6e 64 |an save |a redund|
|00005a80| 61 6e 74 0d 09 20 63 61 | 6c 6c 20 74 6f 20 53 79 |ant.. ca|ll to Sy|
|00005a90| 73 45 6e 76 69 72 6f 6e | 73 20 62 79 20 63 61 6c |sEnviron|s by cal|
|00005aa0| 6c 69 6e 67 20 69 74 20 | 61 66 74 65 72 20 69 6e |ling it |after in|
|00005ab0| 69 74 69 61 6c 69 7a 69 | 6e 67 20 41 70 70 6c 65 |itializi|ng Apple|
|00005ac0| 54 61 6c 6b 2e 7d 0d 09 | 20 0d 09 69 67 6e 6f 72 |Talk.}..| ..ignor|
|00005ad0| 65 45 72 72 6f 72 20 3a | 3d 20 53 79 73 45 6e 76 |eError :|= SysEnv|
|00005ae0| 69 72 6f 6e 73 28 6b 53 | 79 73 45 6e 76 69 72 6f |irons(kS|ysEnviro|
|00005af0| 6e 73 56 65 72 73 69 6f | 6e 2c 20 67 4d 61 63 29 |nsVersio|n, gMac)|
|00005b00| 3b 0d 09 0d 09 7b 4d 61 | 6b 65 20 73 75 72 65 20 |;....{Ma|ke sure |
|00005b10| 74 68 61 74 20 74 68 65 | 20 6d 61 63 68 69 6e 65 |that the| machine|
|00005b20| 20 68 61 73 20 61 74 20 | 6c 65 61 73 74 20 31 32 | has at |least 12|
|00005b30| 38 4b 20 52 4f 4d 73 2e | 20 49 66 20 69 74 20 64 |8K ROMs.| If it d|
|00005b40| 6f 65 73 6e 27 74 2c 20 | 65 78 69 74 2e 7d 0d 09 |oesn't, |exit.}..|
|00005b50| 0d 09 49 46 20 67 4d 61 | 63 2e 6d 61 63 68 69 6e |..IF gMa|c.machin|
|00005b60| 65 54 79 70 65 20 3c 20 | 30 20 54 48 45 4e 20 42 |eType < |0 THEN B|
|00005b70| 69 67 42 61 64 45 72 72 | 6f 72 28 65 57 72 6f 6e |igBadErr|or(eWron|
|00005b80| 67 4d 61 63 68 69 6e 65 | 29 3b 0d 09 0d 09 7b 31 |gMachine|);....{1|
|00005b90| 2e 30 31 20 2d 20 57 65 | 20 75 73 65 64 20 74 6f |.01 - We| used to|
|00005ba0| 20 6d 61 6b 65 20 61 20 | 63 68 65 63 6b 20 66 6f | make a |check fo|
|00005bb0| 72 20 6d 65 6d 6f 72 79 | 20 61 74 20 74 68 69 73 |r memory| at this|
|00005bc0| 20 70 6f 69 6e 74 20 62 | 79 20 65 78 61 6d 69 6e | point b|y examin|
|00005bd0| 69 6e 67 20 41 70 70 6c | 4c 69 6d 69 74 2c 0d 09 |ing Appl|Limit,..|
|00005be0| 20 41 70 70 6c 69 63 5a | 6f 6e 65 2c 20 61 6e 64 | ApplicZ|one, and|
|00005bf0| 20 53 74 61 63 6b 53 70 | 61 63 65 20 61 6e 64 20 | StackSp|ace and |
|00005c00| 63 6f 6d 70 61 72 69 6e | 67 20 74 68 61 74 20 74 |comparin|g that t|
|00005c10| 6f 20 74 68 65 20 6d 69 | 6e 69 6d 75 6d 20 73 69 |o the mi|nimum si|
|00005c20| 7a 65 20 77 65 20 74 6f | 6c 64 0d 09 20 4d 75 6c |ze we to|ld.. Mul|
|00005c30| 74 69 46 69 6e 64 65 72 | 20 77 65 20 6e 65 65 64 |tiFinder| we need|
|00005c40| 65 64 2e 20 54 68 69 73 | 20 64 69 64 20 6e 6f 74 |ed. This| did not|
|00005c50| 20 77 6f 72 6b 20 77 65 | 6c 6c 20 62 65 63 61 75 | work we|ll becau|
|00005c60| 73 65 20 69 74 20 61 73 | 73 75 6d 65 64 20 74 6f |se it as|sumed to|
|00005c70| 6f 20 6d 75 63 68 20 61 | 62 6f 75 74 0d 09 20 74 |o much a|bout.. t|
|00005c80| 68 65 20 72 65 6c 61 74 | 69 6f 6e 73 68 69 70 20 |he relat|ionship |
|00005c90| 62 65 74 77 65 65 6e 20 | 77 68 61 74 20 77 65 20 |between |what we |
|00005ca0| 61 73 6b 65 64 20 4d 75 | 6c 74 69 46 69 6e 64 65 |asked Mu|ltiFinde|
|00005cb0| 72 20 66 6f 72 20 61 6e | 64 20 77 68 61 74 20 77 |r for an|d what w|
|00005cc0| 65 20 77 6f 75 6c 64 20 | 61 63 74 75 61 6c 6c 79 |e would |actually|
|00005cd0| 0d 09 20 67 65 74 20 62 | 61 63 6b 2c 20 61 73 20 |.. get b|ack, as |
|00005ce0| 77 65 6c 6c 20 61 73 20 | 68 6f 77 20 74 6f 20 6d |well as |how to m|
|00005cf0| 65 61 73 75 72 65 20 69 | 74 2e 20 49 6e 73 74 65 |easure i|t. Inste|
|00005d00| 61 64 2c 20 77 65 20 77 | 69 6c 6c 20 75 73 65 20 |ad, we w|ill use |
|00005d10| 61 6e 20 61 6c 74 65 72 | 6e 61 74 65 0d 09 20 6d |an alter|nate.. m|
|00005d20| 65 74 68 6f 64 20 63 6f | 6d 70 72 69 73 65 64 20 |ethod co|mprised |
|00005d30| 6f 66 20 74 77 6f 20 73 | 74 65 70 73 2e 7d 0d 09 |of two s|teps.}..|
|00005d40| 20 0d 09 7b 49 74 20 69 | 73 20 62 65 74 74 65 72 | ..{It i|s better|
|00005d50| 20 74 6f 20 66 69 72 73 | 74 20 63 68 65 63 6b 20 | to firs|t check |
|00005d60| 74 68 65 20 73 69 7a 65 | 20 6f 66 20 74 68 65 20 |the size| of the |
|00005d70| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 68 65 61 70 |applicat|ion heap|
|00005d80| 20 61 67 61 69 6e 73 74 | 20 61 20 76 61 6c 75 65 | against| a value|
|00005d90| 0d 09 20 74 68 61 74 20 | 79 6f 75 20 68 61 76 65 |.. that |you have|
|00005da0| 20 64 65 74 65 72 6d 69 | 6e 65 64 20 69 73 20 74 | determi|ned is t|
|00005db0| 68 65 20 73 6d 61 6c 6c | 65 73 74 20 68 65 61 70 |he small|est heap|
|00005dc0| 20 74 68 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e | the app|lication|
|00005dd0| 20 63 61 6e 20 72 65 61 | 73 6f 6e 61 62 6c 79 0d | can rea|sonably.|
|00005de0| 09 20 77 6f 72 6b 20 69 | 6e 2e 20 54 68 69 73 20 |. work i|n. This |
|00005df0| 6e 75 6d 62 65 72 20 73 | 68 6f 75 6c 64 20 62 65 |number s|hould be|
|00005e00| 20 64 65 72 69 76 65 64 | 20 62 79 20 65 78 61 6d | derived| by exam|
|00005e10| 69 6e 69 6e 67 20 74 68 | 65 20 73 69 7a 65 20 6f |ining th|e size o|
|00005e20| 66 20 74 68 65 20 68 65 | 61 70 20 74 68 61 74 0d |f the he|ap that.|
|00005e30| 09 20 69 73 20 61 63 74 | 75 61 6c 6c 79 20 70 72 |. is act|ually pr|
|00005e40| 6f 76 69 64 65 64 20 62 | 79 20 4d 75 6c 74 69 46 |ovided b|y MultiF|
|00005e50| 69 6e 64 65 72 20 77 68 | 65 6e 20 74 68 65 20 6d |inder wh|en the m|
|00005e60| 69 6e 69 6d 75 6d 20 73 | 69 7a 65 20 72 65 71 75 |inimum s|ize requ|
|00005e70| 65 73 74 65 64 20 69 73 | 20 75 73 65 64 2e 0d 09 |ested is| used...|
|00005e80| 20 54 68 65 20 64 65 72 | 69 76 61 74 69 6f 6e 20 | The der|ivation |
|00005e90| 6f 66 20 74 68 65 20 6d | 69 6e 69 6d 75 6d 20 73 |of the m|inimum s|
|00005ea0| 69 7a 65 20 72 65 71 75 | 65 73 74 65 64 20 66 72 |ize requ|ested fr|
|00005eb0| 6f 6d 20 4d 75 6c 74 69 | 46 69 6e 64 65 72 20 69 |om Multi|Finder i|
|00005ec0| 73 20 64 65 73 63 72 69 | 62 65 64 0d 09 20 69 6e |s descri|bed.. in|
|00005ed0| 20 53 61 6d 70 6c 65 2e | 68 2e 20 54 68 65 20 63 | Sample.|h. The c|
|00005ee0| 68 65 63 6b 20 73 68 6f | 75 6c 64 20 62 65 20 6d |heck sho|uld be m|
|00005ef0| 61 64 65 20 62 65 63 61 | 75 73 65 20 74 68 65 20 |ade beca|use the |
|00005f00| 70 72 65 66 65 72 72 65 | 64 20 73 69 7a 65 20 63 |preferre|d size c|
|00005f10| 61 6e 20 65 6e 64 20 75 | 70 0d 09 20 62 65 69 6e |an end u|p.. bein|
|00005f20| 67 20 73 65 74 20 73 6d | 61 6c 6c 65 72 20 74 68 |g set sm|aller th|
|00005f30| 61 6e 20 74 68 65 20 6d | 69 6e 69 6d 75 6d 20 73 |an the m|inimum s|
|00005f40| 69 7a 65 20 62 79 20 74 | 68 65 20 75 73 65 72 2e |ize by t|he user.|
|00005f50| 20 54 68 69 73 20 65 78 | 74 72 61 20 63 68 65 63 | This ex|tra chec|
|00005f60| 6b 20 61 63 74 73 20 74 | 6f 0d 09 20 69 6e 73 75 |k acts t|o.. insu|
|00005f70| 72 65 20 74 68 61 74 20 | 79 6f 75 72 20 61 70 70 |re that |your app|
|00005f80| 6c 69 63 61 74 69 6f 6e | 20 69 73 20 73 74 61 72 |lication| is star|
|00005f90| 74 69 6e 67 20 66 72 6f | 6d 20 61 20 73 6f 6c 69 |ting fro|m a soli|
|00005fa0| 64 20 6d 65 6d 6f 72 79 | 20 66 6f 75 6e 64 61 74 |d memory| foundat|
|00005fb0| 69 6f 6e 2e 7d 0d 09 20 | 0d 09 49 46 20 4f 52 44 |ion.}.. |..IF ORD|
|00005fc0| 28 47 65 74 41 70 70 6c | 4c 69 6d 69 74 29 20 2d |(GetAppl|Limit) -|
|00005fd0| 20 4f 52 44 28 41 70 70 | 6c 69 63 5a 6f 6e 65 29 | ORD(App|licZone)|
|00005fe0| 20 3c 20 6b 4d 69 6e 48 | 65 61 70 20 54 48 45 4e | < kMinH|eap THEN|
|00005ff0| 20 42 69 67 42 61 64 45 | 72 72 6f 72 28 65 53 6d | BigBadE|rror(eSm|
|00006000| 61 6c 6c 53 69 7a 65 29 | 3b 0d 09 0d 09 7b 4e 65 |allSize)|;....{Ne|
|00006010| 78 74 2c 20 6d 61 6b 65 | 20 73 75 72 65 20 74 68 |xt, make| sure th|
|00006020| 61 74 20 65 6e 6f 75 67 | 68 20 6d 65 6d 6f 72 79 |at enoug|h memory|
|00006030| 20 69 73 20 66 72 65 65 | 20 66 6f 72 20 79 6f 75 | is free| for you|
|00006040| 72 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 74 6f |r applic|ation to|
|00006050| 20 72 75 6e 2e 20 49 74 | 0d 09 20 69 73 20 70 6f | run. It|.. is po|
|00006060| 73 73 69 62 6c 65 20 66 | 6f 72 20 61 20 73 69 74 |ssible f|or a sit|
|00006070| 75 61 74 69 6f 6e 20 74 | 6f 20 61 72 69 73 65 20 |uation t|o arise |
|00006080| 77 68 65 72 65 20 74 68 | 65 20 68 65 61 70 20 6d |where th|e heap m|
|00006090| 61 79 20 68 61 76 65 20 | 62 65 65 6e 20 6f 66 20 |ay have |been of |
|000060a0| 72 65 71 75 69 72 65 64 | 0d 09 20 73 69 7a 65 2c |required|.. size,|
|000060b0| 20 62 75 74 20 61 20 6c | 61 72 67 65 20 73 63 72 | but a l|arge scr|
|000060c0| 61 70 20 77 61 73 20 6c | 6f 61 64 65 64 20 77 68 |ap was l|oaded wh|
|000060d0| 69 63 68 20 6c 65 66 74 | 20 74 6f 6f 20 6c 69 74 |ich left| too lit|
|000060e0| 74 6c 65 20 6d 65 6d 6f | 72 79 2e 20 54 6f 20 63 |tle memo|ry. To c|
|000060f0| 68 65 63 6b 20 66 6f 72 | 0d 09 20 74 68 69 73 2c |heck for|.. this,|
|00006100| 20 63 61 6c 6c 20 50 75 | 72 67 65 53 70 61 63 65 | call Pu|rgeSpace|
|00006110| 20 61 6e 64 20 63 6f 6d | 70 61 72 65 20 74 68 65 | and com|pare the|
|00006120| 20 72 65 73 75 6c 74 20 | 77 69 74 68 20 61 20 76 | result |with a v|
|00006130| 61 6c 75 65 20 74 68 61 | 74 20 79 6f 75 20 68 61 |alue tha|t you ha|
|00006140| 76 65 20 64 65 74 65 72 | 6d 69 6e 65 64 0d 09 20 |ve deter|mined.. |
|00006150| 69 73 20 74 68 65 20 6d | 69 6e 69 6d 75 6d 20 61 |is the m|inimum a|
|00006160| 6d 6f 75 6e 74 20 6f 66 | 20 66 72 65 65 20 6d 65 |mount of| free me|
|00006170| 6d 6f 72 79 20 79 6f 75 | 72 20 61 70 70 6c 69 63 |mory you|r applic|
|00006180| 61 74 69 6f 6e 20 6e 65 | 65 64 73 20 61 74 20 69 |ation ne|eds at i|
|00006190| 6e 69 74 69 61 6c 69 7a | 61 74 69 6f 6e 2e 0d 09 |nitializ|ation...|
|000061a0| 20 54 68 69 73 20 6e 75 | 6d 62 65 72 20 63 61 6e | This nu|mber can|
|000061b0| 20 62 65 20 64 65 72 69 | 76 65 64 20 73 65 76 65 | be deri|ved seve|
|000061c0| 72 61 6c 20 64 69 66 66 | 65 72 65 6e 74 20 77 61 |ral diff|erent wa|
|000061d0| 79 73 2e 20 4f 6e 65 20 | 77 61 79 20 74 68 61 74 |ys. One |way that|
|000061e0| 20 69 73 20 66 61 69 72 | 6c 79 0d 09 20 73 74 72 | is fair|ly.. str|
|000061f0| 61 69 67 68 74 66 6f 72 | 77 61 72 64 20 69 73 20 |aightfor|ward is |
|00006200| 74 6f 20 72 75 6e 20 74 | 68 65 20 61 70 70 6c 69 |to run t|he appli|
|00006210| 63 61 74 69 6f 6e 20 69 | 6e 20 74 68 65 20 6d 69 |cation i|n the mi|
|00006220| 6e 69 6d 75 6d 20 73 69 | 7a 65 20 63 6f 6e 66 69 |nimum si|ze confi|
|00006230| 67 75 72 61 74 69 6f 6e | 0d 09 20 61 73 20 64 65 |guration|.. as de|
|00006240| 73 63 72 69 62 65 64 20 | 70 72 65 76 69 6f 75 73 |scribed |previous|
|00006250| 6c 79 2e 20 43 61 6c 6c | 20 50 75 72 67 65 53 70 |ly. Call| PurgeSp|
|00006260| 61 63 65 20 61 74 20 69 | 6e 69 74 69 61 6c 69 7a |ace at i|nitializ|
|00006270| 61 74 69 6f 6e 20 61 6e | 64 20 65 78 61 6d 69 6e |ation an|d examin|
|00006280| 65 20 74 68 65 20 76 61 | 6c 75 65 0d 09 20 72 65 |e the va|lue.. re|
|00006290| 74 75 72 6e 65 64 2e 20 | 48 6f 77 65 76 65 72 2c |turned. |However,|
|000062a0| 20 79 6f 75 20 73 68 6f | 75 6c 64 20 6d 61 6b 65 | you sho|uld make|
|000062b0| 20 73 75 72 65 20 74 68 | 61 74 20 74 68 69 73 20 | sure th|at this |
|000062c0| 72 65 73 75 6c 74 20 69 | 73 20 6e 6f 74 20 62 65 |result i|s not be|
|000062d0| 69 6e 67 20 6d 6f 64 69 | 66 69 65 64 0d 09 20 62 |ing modi|fied.. b|
|000062e0| 79 20 74 68 65 20 73 63 | 72 61 70 27 73 20 70 72 |y the sc|rap's pr|
|000062f0| 65 73 65 6e 63 65 2e 20 | 59 6f 75 20 63 61 6e 20 |esence. |You can |
|00006300| 64 6f 20 74 68 61 74 20 | 62 79 20 63 61 6c 6c 69 |do that |by calli|
|00006310| 6e 67 20 5a 65 72 6f 53 | 63 72 61 70 20 62 65 66 |ng ZeroS|crap bef|
|00006320| 6f 72 65 20 63 61 6c 6c | 69 6e 67 0d 09 20 50 75 |ore call|ing.. Pu|
|00006330| 72 67 65 53 70 61 63 65 | 2e 20 4d 61 6b 65 20 73 |rgeSpace|. Make s|
|00006340| 75 72 65 20 74 6f 20 72 | 65 6d 6f 76 65 20 74 68 |ure to r|emove th|
|00006350| 61 74 20 63 61 6c 6c 20 | 62 65 66 6f 72 65 20 73 |at call |before s|
|00006360| 68 69 70 70 69 6e 67 2c | 20 74 68 6f 75 67 68 2e |hipping,| though.|
|00006370| 7d 0d 09 20 0d 09 7b 2a | 20 5a 65 72 6f 53 63 72 |}.. ..{*| ZeroScr|
|00006380| 61 70 3b 20 2a 7d 0d 09 | 50 75 72 67 65 53 70 61 |ap; *}..|PurgeSpa|
|00006390| 63 65 28 74 6f 74 61 6c | 2c 20 63 6f 6e 74 69 67 |ce(total|, contig|
|000063a0| 29 3b 0d 09 49 46 20 74 | 6f 74 61 6c 20 3c 20 6b |);..IF t|otal < k|
|000063b0| 4d 69 6e 53 70 61 63 65 | 20 54 48 45 4e 0d 09 09 |MinSpace| THEN...|
|000063c0| 49 46 20 55 6e 6c 6f 61 | 64 53 63 72 61 70 20 3c |IF Unloa|dScrap <|
|000063d0| 3e 20 6e 6f 45 72 72 20 | 54 48 45 4e 0d 09 09 09 |> noErr |THEN....|
|000063e0| 42 69 67 42 61 64 45 72 | 72 6f 72 28 65 4e 6f 4d |BigBadEr|ror(eNoM|
|000063f0| 65 6d 6f 72 79 29 0d 09 | 09 45 4c 53 45 20 42 45 |emory)..|.ELSE BE|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.